The current authentication state and the authentication actions.
| Property | Type | Description |
|---|---|---|
error? | Error | Error encountered during authentication, if any. |
getTokens | (options?: GetTokensOptions) => Promise<MonoCloudTokens> | Retrieves the active tokens, refreshing them if they have expired. |
isAuthenticated | boolean | Flag indicating if the user is authenticated. |
isLoading | boolean | Flag indicating if the authentication state is still loading. |
refetchUserInfo | () => Promise<void> | Refetches the user's profile from the UserInfo endpoint and updates the session. |
refreshSession | (refreshOptions?: RefreshOptions) => Promise<void> | Refreshes the current session using the Refresh Token Grant. |
session? | MonoCloudSession | The current session, including tokens and the user, if available. |
signIn | (signInOptions?: SignInOptions) => Promise<void> | Initiates the sign-in flow. |
signInSilent | (signInSilentOptions?: SignInSilentOptions) => Promise<MonoCloudSession> | Attempts to silently restore the session via a hidden iframe (prompt=none). |
signOut | (signOutOptions?: SignOutOptions) => Promise<void> | Initiates the sign-out flow. |
user? | MonoCloudUser | The authenticated user's information, if available. |