diff options
Diffstat (limited to 'src/api/routes/auth/verify/view-backup-codes-challenge.ts')
-rw-r--r-- | src/api/routes/auth/verify/view-backup-codes-challenge.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/routes/auth/verify/view-backup-codes-challenge.ts b/src/api/routes/auth/verify/view-backup-codes-challenge.ts index d524e0f7..846e186b 100644 --- a/src/api/routes/auth/verify/view-backup-codes-challenge.ts +++ b/src/api/routes/auth/verify/view-backup-codes-challenge.ts @@ -1,6 +1,6 @@ -import { Router, Request, Response } from "express"; import { route } from "@fosscord/api"; -import { FieldErrors, User, BackupCodesChallengeSchema } from "@fosscord/util"; +import { BackupCodesChallengeSchema, FieldErrors, User } from "@fosscord/util"; +import { Request, Response, Router } from "express"; let bcrypt: any; try { @@ -17,13 +17,13 @@ router.post("/", route({ body: "BackupCodesChallengeSchema" }), async (req: Requ const user = await User.findOneOrFail({ where: { id: req.user_id }, select: ["data"] }); - if (!await bcrypt.compare(password, user.data.hash || "")) { + if (!(await bcrypt.compare(password, user.data.hash || ""))) { throw FieldErrors({ password: { message: req.t("auth:login.INVALID_PASSWORD"), code: "INVALID_PASSWORD" } }); } return res.json({ nonce: "NoncePlaceholder", - regenerate_nonce: "RegenNoncePlaceholder", + regenerate_nonce: "RegenNoncePlaceholder" }); }); |