From 73aeca20de08a2a4034476d6282b256bea431465 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 6 Apr 2021 04:10:24 +0200 Subject: [PATCH] :bug: fix login --- package-lock.json | 4 ++-- src/routes/auth/login.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e13791d1..ba585fb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4614,7 +4614,7 @@ }, "node_modules/fosscord-server-util": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#e5f408be0889562f6fa36ac1bb1730e50bf1951f", + "resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#770b07400e282c5e06fe0638d791139e3984f50f", "license": "ISC", "dependencies": { "jsonwebtoken": "^8.5.1", @@ -16151,7 +16151,7 @@ "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, "fosscord-server-util": { - "version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#e5f408be0889562f6fa36ac1bb1730e50bf1951f", + "version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#770b07400e282c5e06fe0638d791139e3984f50f", "from": "fosscord-server-util@github:fosscord/fosscord-server-util", "requires": { "jsonwebtoken": "^8.5.1", diff --git a/src/routes/auth/login.ts b/src/routes/auth/login.ts index de7a16d4..15aa2371 100644 --- a/src/routes/auth/login.ts +++ b/src/routes/auth/login.ts @@ -40,7 +40,7 @@ router.post( } // the salt is saved in the password refer to bcrypt docs - const same_password = await bcrypt.compare(password, user.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" },