summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorJulien Dessaux2023-04-29 15:39:25 +0200
committerJulien Dessaux2023-04-29 15:39:57 +0200
commitc86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4 (patch)
tree752b2396be946a0b75553bb3ac5feff4b40f476a /database
parentTypo (diff)
downloadjeux-de-mots-c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4.tar.gz
jeux-de-mots-c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4.tar.bz2
jeux-de-mots-c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4.zip
Fixed invalid username handling
Diffstat (limited to '')
-rw-r--r--database/users.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/database/users.js b/database/users.js
index cc50bdc..353b54a 100644
--- a/database/users.js
+++ b/database/users.js
@@ -34,6 +34,9 @@ export async function login(username, password) {
console.log(err);
return null;
}
+ if (user === undefined) {
+ return null;
+ }
const result = await bcrypt.compare(password, user.hash);
if (result === true) {
return {