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