addOnTokenRefreshCallback

Receive a callback when the bearer token refreshes

You can add a callback method that will be called each time the bearer token is refreshed. This can only be used while using the Arkane Connect JS authentication client. This function has one parameter: a callback function accepting one parameter (the new bearer token) and returning void.

arkaneConnect.addOnTokenRefreshCallback(token => {
console.log('Refreshed bearer token: ' + token);
});

Signature

arkaneConnect.addOnTokenRefreshCallback(tokenRefreshCallback: (token: string) => void): void

Returns

Promise<AuthenticationResult>

Parameters

Parameter

Description

tokenRefreshCallback

a callback function accepting one parameter (the new bearer token) and returning void. (Required)

Example

arkaneConnect.addOnTokenRefreshCallback(token => {
console.log('Refreshed bearer token: ' + token);
});

Object Types