Email class

Provides email-based authentication methods for users.

The Email class handles all email-related authentication operations including email verification, password authentication, magic link authentication, and password reset functionality. It integrates with device attestation to ensure secure authentication flows.

Usage

final calljmp = Calljmp();

// Check if user is authenticated
final isAuth = await calljmp.users.auth.email.authenticated();

// Authenticate with email and password
final user = await calljmp.users.auth.email.authenticate(
  email: 'user@example.com',
  password: 'secure_password',
  policy: UserAuthenticationPolicy.signInOrCreate,
);

// Reset password
final challenge = await calljmp.users.auth.email.forgotPassword(
  email: 'user@example.com',
);
await calljmp.users.auth.email.resetPassword(
  email: 'user@example.com',
  challengeToken: challenge.challengeToken,
  password: 'new_password',
);

Constructors

Email(Config _config, Attestation _attestation, Auth _auth)
Creates a new Email authentication handler.

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

authenticate({String? challengeToken, required String email, bool? emailVerified, String? name, String? password, List<String>? tags, UserAuthenticationPolicy? policy, bool? doNotNotify}) Future<User>
Authenticates a user and returns a User object.
confirm({String? email, required String challengeToken}) Future<({bool existingUser})>
Confirms a verification challenge.
forgotPassword({String? email, bool? doNotNotify}) Future<({String challengeToken})>
Initiates password reset process.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetPassword({String? email, required String challengeToken, required String password, bool? doNotNotify}) Future<void>
Resets the user's password using a challenge token.
toString() String
A string representation of this object.
inherited
verify({String? email, required UserAuthenticationProvider provider, bool? doNotNotify}) Future<({String challengeToken, bool existingUser})>
Initiates email verification for authentication.

Operators

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