pub enum TwoFactorError {
InvalidCode,
InvalidBackupCode,
OtpHasExpired,
TooManyAttempts,
TotpNotEnabled,
TwoFactorNotEnabled,
InvalidTwoFactorCookie,
}Expand description
Why a two-factor request failed. Codes and statuses match Better Auth’s two-factor plugin.
Variants§
InvalidCode
INVALID_CODE: the TOTP or email code is wrong, expired or already used.
InvalidBackupCode
INVALID_BACKUP_CODE: the backup code is wrong or already used.
OtpHasExpired
OTP_HAS_EXPIRED: the email code is past its lifetime; send a new one.
TooManyAttempts
TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: five wrong email codes burn the code.
TotpNotEnabled
TOTP_NOT_ENABLED: the user never called /two-factor/enable.
TwoFactorNotEnabled
TWO_FACTOR_NOT_ENABLED: two-factor isn’t on for this user yet.
InvalidTwoFactorCookie
INVALID_TWO_FACTOR_COOKIE: no session, and no valid pending sign-in cookie.
Implementations§
Trait Implementations§
Source§impl Clone for TwoFactorError
impl Clone for TwoFactorError
impl Copy for TwoFactorError
Source§impl Debug for TwoFactorError
impl Debug for TwoFactorError
impl Eq for TwoFactorError
Source§impl ErrorCodes for TwoFactorError
impl ErrorCodes for TwoFactorError
Source§impl From<TwoFactorError> for AuthError
impl From<TwoFactorError> for AuthError
Source§fn from(err: TwoFactorError) -> Self
fn from(err: TwoFactorError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TwoFactorError
impl PartialEq for TwoFactorError
impl StructuralPartialEq for TwoFactorError
Auto Trait Implementations§
impl Forget for TwoFactorError
impl Freeze for TwoFactorError
impl Move for TwoFactorError
impl RefUnwindSafe for TwoFactorError
impl Send for TwoFactorError
impl Sync for TwoFactorError
impl Unpin for TwoFactorError
impl UnsafeUnpin for TwoFactorError
impl UnwindSafe for TwoFactorError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more