HosteDayAuth class
Provides Firebase-style authentication methods for HosteDay.
Supports:
- Email/password sign-in
- Email/password registration
- Session restoration
- Current user access
- Auth state streams
- Password reset requests
- User reload and profile update
- Sign-out
Constructors
-
HosteDayAuth({required HosteDayConfig config, required HosteDayHttpClient http, required HosteDayAuthStorage storage, Future<
void> onSessionCleared()?}) - Creates a HosteDay auth service.
Properties
- config → HosteDayConfig
-
API configuration that defines auth endpoints.
final
- currentSession → HosteDaySession?
-
Returns the active authenticated session, or null when signed out.
no setter
- currentUser → HosteDayUser?
-
Returns the active HosteDay user, or null when signed out.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- http → HosteDayHttpClient
-
HTTP client used for authentication requests.
final
- isInitialized → bool
-
Whether the local session has been restored from storage.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storage → HosteDayAuthStorage
-
Persistent storage for the authenticated session.
final
Methods
-
authStateChanges(
) → Stream< HosteDayUser?> - Emits the current auth state immediately, then emits on sign-in/sign-out.
-
createUserWithEmailAndPassword(
{required String email, required String password, Map< String, dynamic> additionalData = const <String, dynamic>{}}) → Future<HosteDayUserCredential> - Creates a new user and signs that user in.
-
dispose(
) → Future< void> - Releases stream resources without deleting the persisted session.
-
getAccessToken(
) → Future< String?> - Returns the current access token, or null when signed out.
-
idTokenChanges(
) → Stream< HosteDayUser?> - Emits the current user immediately, then emits on auth or token changes.
-
initialize(
) → Future< void> - Restores the saved session after SDK initialization.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reload(
) → Future< HosteDayUser> - Reloads the authenticated user's profile from the HosteDay API.
-
sendCurrentUserPasswordResetEmail(
) → Future< void> - Sends a password-reset email to the currently authenticated user.
-
sendEmailVerification(
) → Future< void> - Requests an email verification message for the current user.
-
sendPasswordResetEmail(
{required String email, Map< String, dynamic> additionalData = const <String, dynamic>{}}) → Future<void> - Requests a password-reset email.
-
signInWithEmailAndPassword(
{required String email, required String password}) → Future< HosteDayUserCredential> - Signs in an existing user using email and password.
-
signOut(
) → Future< void> - Signs out locally and attempts to invalidate the remote Laravel session.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateAvatar(
{required Uint8List bytes, required String extension}) → Future< HosteDayUser> - Uploads and updates the authenticated user's avatar.
-
updateProfile(
{required String name}) → Future< HosteDayUser> - Updates the authenticated user's name.
-
userChanges(
) → Stream< HosteDayUser?> - Emits the current user immediately, then emits on auth or user changes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited