Methods reference for Supertab.auth
Supertab.auth
is an entry point for authenticating a user. It abstracts the authentication flow and auth state management, allowing your application to easily implement login functionality and make authenticated requests to the Customer API.
Once a user is authenticated, the necessary authorization headers are passed to each Customer API request dispatched via Supertab.api.
Supertab.auth
handles the event of token expiration and refreshes the token
before attempting to make an authenticated call to the Customer API. There is no need to re-authenticate a user manually.session
null
if the user is not authenticated. See AuthData for the type definition.
status
missing
- The user is not authenticated.expired
- The user’s session has expired and needs to be refreshed before making an authenticated request to the Customer API. See start method for more details on how to refresh the session.valid
- The user is authenticated.start
true
, the client does not open the Supertab SSO popup and
instead attempts to refresh the session in the background.
Refreshing the session is only possible if there as an existing expired session in browser storage
Returns null
for unknown users with no prior session.register
and login
.Field | Type | Description |
---|---|---|
accessToken | string | The access token used for making authenticated requests to the Customer API. |
refreshToken | string | The token used to obtain a new access token when the current one expires. |
expiresAt | Date | The date and time when the access token will expire. |
tokenType | string | The type of authentication token, typically “Bearer”. |
reset