mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 08:31:37 -05:00
fix(two-factor): remove incorrect blocking logic in OTP setup and verification (#6322)
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user