fix(two-factor): remove incorrect blocking logic in OTP setup and verification (#6322)

This commit is contained in:
Isaac Riehm
2025-11-26 09:49:46 -07:00
committed by GitHub
parent ff98047eaa
commit b66d8744ff

View File

@@ -177,11 +177,6 @@ export const otp2fa = (options?: OTPOptions | undefined) => {
});
}
const { session, key } = await verifyTwoFactor(ctx);
if (!session.user.twoFactorEnabled) {
throw new APIError("BAD_REQUEST", {
message: TWO_FACTOR_ERROR_CODES.OTP_NOT_ENABLED,
});
}
const code = generateRandomString(opts.digits, "0-9");
const hashedCode = await storeOTP(ctx, code);
await ctx.context.internalAdapter.createVerificationValue({