EmailOtpPlugin<TContext> class
final
Typed email OTP plugin modeled on the common sign-in, verification, and password-recovery OTP flows.
Constructors
-
EmailOtpPlugin({required AuthEmailOtpSender<
TContext> sendCode, required String secret, int otpLength = 6, Duration expiresIn = const Duration(minutes: 5), int allowedAttempts = 3, bool disableSignUp = false, String generateOtp(int length)?}) - Creates an email OTP provider for sign-in and verification flows.
Properties
- allowedAttempts → int
-
Maximum failed attempts before lockout.
final
-
authenticationMethodKinds
→ Set<
AuthAuthenticationMethodKind> -
Authentication-method kinds exposed by this plugin.
no setteroverride
- authenticationMethodNamespace → String
-
Namespace for OTP authentication methods.
no setteroverride
- authenticationMethodStore → Object
-
Configured OTP store used for authentication-method inventory.
no setteroverride
-
clientOperations
→ Iterable<
AuthClientOperationDescriptor> -
Client operation descriptors derived from endpoints.
no setteroverride
- dataContract → AuthServerPluginDataContract
-
Declares the OTP authentication and user-data namespaces.
no setteroverride
- disableSignUp → bool
-
Whether sign-in rejects unknown email addresses instead of creating users.
final
-
endpoints
→ Iterable<
AuthEndpointDescriptor< TContext> > -
POST endpoint contracts for issuing, checking, signing in, and verifying email.
no setteroverride
- expiresIn → Duration
-
Lifetime of an issued OTP.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Stable plugin identifier.
no setteroverride
- otpLength → int
-
Number of decimal digits generated for each OTP.
final
-
persistenceSchemas
→ Iterable<
AuthPersistenceSchema> -
Digest-only OTP persistence schema and atomic verification operation.
no setteroverride
-
rateLimitOperations
→ Iterable<
AuthRateLimitOperation> -
Rate-limit operations required by endpoints.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sendCode
→ AuthEmailOtpSender<
TContext> -
Callback that receives the raw OTP only for delivery.
final
- userDataNamespace → String
-
Namespace for user data owned by this plugin.
no setteroverride
Methods
-
authenticationMethodsForUser(
String userId) → Future< AuthAuthenticationMethodSnapshot> -
Lists the active OTP method for an eligible
userId.override -
checkVerificationOtp(
{required String email, required AuthEmailOtpType type, required String code, DateTime? now}) → Future< void> - Verifies and consumes an OTP without creating a session.
-
configure(
AuthServerPluginContext< TContext> context) → void -
Configures the typed OTP backend and deletion-coordinator host.
override
-
createUserDeletionPlan(
AuthUser user) → Future< AuthUserDeletionPlan> -
Creates a plan that removes OTP records for
user.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendVerificationOtp(
{required TContext context, required String email, required AuthEmailOtpType type, DateTime? now}) → Future< void> -
Issues and delivers a new OTP for
emailandtype. -
signInWithOtp(
{required TContext context, required String email, required String code, String? name, String? image, DateTime? now}) → Future< AuthEmailOtpSignInResult> - Consumes an OTP and signs in or creates its verified user.
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyEmail(
{required String userId, required String code, DateTime? now}) → Future< AuthUser> - Consumes an OTP to verify the authenticated user's current email.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited