setTokens(tokenInfo)
Adds the access token to the fetch request headers.
Returns
Not applicable.
Parameters
Name | Type | Description | Required |
tokenInfo | object | The object containing the access token, refresh token, session index, duration of access token expiry, and the token type. | ✅ |
Usage example
In this example, the API adds the access token from the tokenObject
object to the fetch headers.
const tokenObject = {
access_token: 'access_token_value',
refresh_token: 'refresh_token_value',
session_index: 'session_index',
expires_in: 120,
token_type: 'bearer'
};
PCore.getAuthUtils().setTokens(tokenObject);
Previous topic revokeTokens() Next topic APIs in the CaseFollowerApi module