BetterAuthTwoFactor class abstract

Typed wrapper for the Better Auth twoFactor() plugin routes.

Annotations
  • @RestApi.new(callAdapter: BetterAuthCallAdapter)

Constructors

BetterAuthTwoFactor(Dio dio, {String? baseUrl, ParseErrorLogger? errorLogger})
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

disable({required TwoFactorPasswordBody body}) Future<Result<StatusResponse>>
Disables 2FA. Requires the user's password.
enable({required TwoFactorEnableBody body}) Future<Result<TwoFactorEnableResponse>>
Enables 2FA. Returns the TOTP URI (render as a QR code) and backup codes.
generateBackupCodes({required TwoFactorPasswordBody body}) Future<Result<BackupCodesResponse>>
Regenerates backup codes. Requires the user's password.
getTotpUri({required TwoFactorPasswordBody body}) Future<Result<TotpUriResponse>>
Returns the current TOTP URI. Requires the user's password.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendOtp() Future<Result<StatusResponse>>
Sends an OTP over the configured channel (e.g. email).
toString() String
A string representation of this object.
inherited
verifyBackupCode({required TwoFactorVerifyBody body}) Future<Result<SignInEmailResponse>>
Verifies a backup code, completing sign-in when 2FA gated it.
verifyOtp({required TwoFactorVerifyBody body}) Future<Result<SignInEmailResponse>>
Verifies an OTP code, completing sign-in when 2FA gated it.
verifyTotp({required TwoFactorVerifyBody body}) Future<Result<SignInEmailResponse>>
Verifies a TOTP code, completing sign-in when 2FA gated it.

Operators

operator ==(Object other) bool
The equality operator.
inherited