fix(auth): expire stale MFA forms before accepting codes

This commit is contained in:
Clintchiz committed 2026-08-26 19:17:48 +05:30
1 parent 298e34ef2e
commit 0c77de93b4
8 files changed
+82 -11

No files matched your search

+1
View File
@@ -863,6 +863,7 @@ describe("authentication engine", () => {
requires: { mfa: ["totp"] },
});
expect(await engine.beginMfaOtp(firstLogin.mfaToken!, "email-otp")).toBeUndefined();
expect(firstLogin.mfaExpiresAt).toBe(now() + 5 * 60_000);
expect((await engine.verifyEmail(verificationToken)).ok).toBe(true);
const secondLogin = await engine.login({