Configuring totp code when verifying too (#9584)
This commit is contained in:
1 parent
24ed04e6c7
commit
4a30f60622
1 file changed
+1
@@ -24,6 +24,7 @@ export const verifyCodeHandler = async ({ ctx, input }: VerifyCodeOptions) => {
|
||||
.update(email + process.env.CALENDSO_ENCRYPTION_KEY)
|
||||
.digest("hex");
|
||||
|
||||
totp.options = { step: 900 };
|
||||
const isValidToken = totp.check(code, secret);
|
||||
|
||||
if (!isValidToken) throw new TRPCError({ code: "BAD_REQUEST", message: "invalid_code" });
|
||||
|
||||
Reference in new issue
Block a user