AuthClient class
Client for authentication operations
Constructors
-
AuthClient({required String baseUrl, required TokenStorage tokenStorage, Client? httpClient, Duration timeout = const Duration(seconds: 30), Map<
String, String> ? headers}) - Creates a new AuthClient instance
Properties
- baseUrl → String
-
Base URL of the auth service
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
Request timeout duration
final
- tokenStorage → TokenStorage
-
Token storage
final
Methods
-
deleteCurrentUser(
) → Future< void> - Deletes the current user
-
forgotPassword(
String email) → Future< void> - Sends a password reset email
-
getCurrentUser(
) → Future< User> - Gets the current user
-
login(
String email, String password) → Future< AuthToken> - Logs in a user
-
logout(
) → Future< void> - Logs out the current user
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshToken(
) → Future< AuthToken> - Refreshes the access token
-
register(
{required String email, required String password, String? name}) → Future< AuthToken> - Registers a new user
-
resetPassword(
{required String token, required String newPassword}) → Future< void> - Resets password with token
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCurrentUser(
{String? name, Map< String, dynamic> ? metadata}) → Future<User> - Updates the current user
-
verifyEmail(
String token) → Future< void> - Verifies email with token
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited