fix: add 2fa and email verification grace period (#10771)

This commit is contained in:
nicktrn authored and GitHub committed 2023-08-17 16:13:04 +02:00
1 parent 28b94a865f
commit 0f2b6bbe1a
8 files changed
+64 -15

No files matched your search

@@ -148,7 +148,10 @@ const providers: Provider[] = [
throw new Error(ErrorCode.InternalServerError);
}
const isValidToken = (await import("otplib")).authenticator.check(credentials.totpCode, secret);
const isValidToken = (await import("@calcom/lib/totp")).totpAuthenticatorCheck(
credentials.totpCode,
secret
);
if (!isValidToken) {
throw new Error(ErrorCode.IncorrectTwoFactorCode);
}