TwoFactorPlugin<T extends User> class

Inheritance

Constructors

TwoFactorPlugin.new()

Properties

dio ↔ Dio
latefinalinherited
fromJsonUser ↔ T Function(Map<String, dynamic> json)
latefinalinherited
getOptions Future<Options> Function({bool isTokenRequired})
latefinalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenStore TokenStore
latefinalinherited

Methods

disableTwoFactor({required String password}) Future<StatusResponse>
Disable two factor This will disable the two factor authentication and delete the backup codes.
enableTwoFactor({required String password, String? issuer}) Future<EnableTwoFactorResponse>
Enable two factor This will generate a TOTP URI and backup codes. Once the user verifies the TOTP URI, the two factor authentication will be enabled.
generateBackupCodes() Future<GenerateBackupCodes>
Generate backup codes
getTotpUri({required String password}) Future<TwoFactorTOTPURI>
Get TOTP URI
initialize({required Dio dio, required Future<Options> getOptions({bool isTokenRequired}), required TokenStore tokenStore, required T fromJsonUser(Map<String, dynamic> json)}) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendOtp() Future<StatusResponse>
Send two factor OTP to the user
toString() String
A string representation of this object.
inherited
verifyBackUpCode({required String code, bool trustDevice = false, bool disableSession = false}) Future<SessionResponse<User>>
Verify backup code
verifyOtp({required String code, bool trustDevice = false}) Future<UserAndTokenResponse>
Verify two factor OTP
verifyTotp({required String code, bool trustDevice = false}) Future<StatusResponse>
Verify TOTP

Operators

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