diff options
author | Julien Dessaux | 2023-04-29 15:39:25 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-04-29 15:39:57 +0200 |
commit | c86bb2adbd906f0a01f8dfcf87eaa3cacf3aa6d4 (patch) | |
tree | 752b2396be946a0b75553bb3ac5feff4b40f476a /database/users.js | |
parent | Typo (diff) | |
download | jeux-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.js | 3 |
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 { |