From 71082eb918f055f07fa45cd44c90fcb0c8dd6a29 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 20 Jan 2023 18:10:47 +1100 Subject: Add ESLint (#941) * Add eslint, switch to lint-staged for precommit * Fix all ESLint errors * Update GH workflow to check prettier and eslint --- src/api/routes/auth/mfa/totp.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/api/routes/auth/mfa') diff --git a/src/api/routes/auth/mfa/totp.ts b/src/api/routes/auth/mfa/totp.ts index 42485535..65cdd397 100644 --- a/src/api/routes/auth/mfa/totp.ts +++ b/src/api/routes/auth/mfa/totp.ts @@ -27,8 +27,8 @@ router.post( "/", route({ body: "TotpSchema" }), async (req: Request, res: Response) => { - const { code, ticket, gift_code_sku_id, login_source } = - req.body as TotpSchema; + // const { code, ticket, gift_code_sku_id, login_source } = + const { code, ticket } = req.body as TotpSchema; const user = await User.findOneOrFail({ where: { @@ -47,7 +47,7 @@ router.post( }); if (!backup) { - const ret = verifyToken(user.totp_secret!, code); + const ret = verifyToken(user.totp_secret || "", code); if (!ret || ret.delta != 0) throw new HTTPError( req.t("auth:login.INVALID_TOTP_CODE"), -- cgit 1.5.1