fix: add 2fa and email verification grace period (#10771)
This commit is contained in:
1 parent
28b94a865f
commit
0f2b6bbe1a
8 files changed
+64
-15
No files matched your search
@@ -3,6 +3,7 @@ import { expect } from "@playwright/test";
|
||||
import { authenticator } from "otplib";
|
||||
|
||||
import { symmetricDecrypt } from "@calcom/lib/crypto";
|
||||
import { totpAuthenticatorCheck } from "@calcom/lib/totp";
|
||||
|
||||
import { test } from "./lib/fixtures";
|
||||
|
||||
@@ -141,7 +142,7 @@ test.describe("2FA Tests", async () => {
|
||||
|
||||
async function fillOtp({ page, secret, noRetry }: { page: Page; secret: string; noRetry?: boolean }) {
|
||||
let token = authenticator.generate(secret);
|
||||
if (!noRetry && !authenticator.check(token, secret)) {
|
||||
if (!noRetry && !totpAuthenticatorCheck(token, secret)) {
|
||||
console.log("Token expired, Renerating.");
|
||||
// Maybe token was just about to expire, try again just once more
|
||||
token = authenticator.generate(secret);
|
||||
|
||||
Reference in new issue
Block a user