Manages the login dialog and auth session. All other components depend on a valid auth state.
Methods
| Method | Parameters | Returns | Notes |
|---|
PromptLogin(dismissable) | bool dismissable = true | void | Shows login dialog |
CancelLogin() | — | void | Dismisses login dialog |
Logout(promptLogin) | bool promptLogin = true | void | Clears session; re-prompts if true |
IsLoggedIn() | — | bool | True when auth state is non-null |
GetAccessToken() | — | string | Empty string if not logged in |
GetState() | — | AuthState? | Null if not logged in |
AddListener(listener) | Action | void | Called on any auth state change |
RemoveListener(listener) | Action | void | |
AuthState
| Field | Type | Notes |
|---|
AccessToken | string | JWT |
RefreshToken | string | |
Expiration | long | Unix timestamp |
RefreshTokenExpiration | long | Unix timestamp |
Tokens refresh automatically. You don’t need to handle expiry manually.