summary refs log tree commit diff
path: root/src/api/routes/auth
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api/routes/auth/login.ts8
-rw-r--r--src/api/routes/auth/mfa/totp.ts2
-rw-r--r--src/api/routes/auth/verify/view-backup-codes-challenge.ts8
3 files changed, 9 insertions, 9 deletions
diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts

index 68b2656a..045b86eb 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.ts
@@ -1,7 +1,7 @@ -import { Request, Response, Router } from "express"; -import { route, getIpAdress, verifyCaptcha } from "@fosscord/api"; -import { Config, User, generateToken, adjustEmail, FieldErrors, LoginSchema } from "@fosscord/util"; +import { getIpAdress, route, verifyCaptcha } from "@fosscord/api"; +import { adjustEmail, Config, FieldErrors, generateToken, LoginSchema, User } from "@fosscord/util"; import crypto from "crypto"; +import { Request, Response, Router } from "express"; let bcrypt: any; try { @@ -38,7 +38,7 @@ router.post("/", route({ body: "LoginSchema" }), async (req: Request, res: Respo captcha_key: verify["error-codes"], captcha_sitekey: sitekey, captcha_service: service - }) + }); } } diff --git a/src/api/routes/auth/mfa/totp.ts b/src/api/routes/auth/mfa/totp.ts
index 4b080af6..65ec7f2f 100644 --- a/src/api/routes/auth/mfa/totp.ts +++ b/src/api/routes/auth/mfa/totp.ts
@@ -1,5 +1,5 @@ import { route } from "@fosscord/api"; -import { BackupCode, generateToken, TotpSchema, User, HTTPError } from "@fosscord/util"; +import { BackupCode, generateToken, HTTPError, TotpSchema, User } from "@fosscord/util"; import { Request, Response, Router } from "express"; import { verifyToken } from "node-2fa"; const router = Router(); 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" }); });