TwoFactorPlugin<T extends User> class
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