Auth class
Provides authentication challenge and state clearing methods.
The Auth class serves as the main authentication controller for the Calljmp SDK. It manages authentication challenges, coordinates with different authentication providers (like email), and handles authentication state management.
Usage
final calljmp = Calljmp();
// Get authentication challenge
final challenge = await calljmp.users.auth.challenge();
// Authenticate with email
final user = await calljmp.users.auth.email.authenticate(
email: 'user@example.com',
password: 'password',
policy: UserAuthenticationPolicy.signInOrCreate,
);
// Clear authentication state
await calljmp.users.auth.clear();
Constructors
- Auth(Config _config, Attestation attestation)
-
Constructs Auth with config and
attestation.
Properties
- apple ↔ Provider
-
Apple authentication provider.
latefinal
- email ↔ Email
-
Email authentication handler.
latefinal
- google ↔ Provider
-
Google authentication provider.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
authenticated(
) → Future< bool> - Checks if the user is currently authenticated (access token is valid).
-
challenge(
) → Future< ({String challengeToken})> - Requests a new authentication challenge token.
-
clear(
) → Future< void> - Clears the current authentication state (removes access token).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited