summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDiego Magdaleno <38844659+DiegoMagdaleno@users.noreply.github.com>2021-07-21 14:47:30 -0500
committerGitHub <noreply@github.com>2021-07-21 14:47:30 -0500
commit3ae50def52f1196713a1b8e9fdb6a2100ddddbca (patch)
treee4bcb0965570cf63669a77c6edf073bd8b4d579f /src
parent[Fix] All messages should have edited_timestamp even if null (diff)
parentfix guild create (diff)
downloadserver-3ae50def52f1196713a1b8e9fdb6a2100ddddbca.tar.xz
Merge branch 'fosscord:master' into master
Diffstat (limited to 'src')
-rw-r--r--src/routes/auth/login.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/routes/auth/login.ts b/src/routes/auth/login.ts

index 1c288716..82cefae8 100644 --- a/src/routes/auth/login.ts +++ b/src/routes/auth/login.ts
@@ -47,15 +47,13 @@ router.post( const user = await UserModel.findOne( { $or: query }, { - projection: { - user_data: { - hash: true - }, - id: true, - user_settings: { - locale: true, - theme: true - } + user_data: { + hash: true + }, + id: true, + user_settings: { + locale: true, + theme: true } } ) @@ -65,7 +63,7 @@ router.post( }); // the salt is saved in the password refer to bcrypt docs - const same_password = await bcrypt.compare(password, user.user_data.hash); + const same_password = await bcrypt.compare(password, user.user_data.hash || ""); if (!same_password) { throw FieldErrors({ password: { message: req.t("auth:login.INVALID_PASSWORD"), code: "INVALID_PASSWORD" } }); }