This function will log the user out of Arkane.
// Log out and redirect to the current pagearkaneConnect.logout({ windowMode: 'REDIRECT' });
The behavior is different depending on the windowMode
used to instantiate ArkaneConnect or provided in the options.
POPUP (default): The user will be logged out in the background and the promise will resolve when finished. This means the application needs to clean up all user data on screen itself.
REDIRECT: The user will be redirected to the logout endpoint of our Arkane authentication provider. Followed by a redirect back to the page the user was on. The page can be altered by using the option redirectUri
. The page refreshes automatically, no cleanup is necessary.
If you set the redirectUri
option, make sure that the SDK and the AuthenticationResult
handling is also present on the page you redirect to.
arkaneConnect.logout(options?: AuthentciationOptions): Promise<void>
Promise<void>
Parameter | Type | Required | Description |
|
| Provide extra options on who to logout |
// Example 1// Log out, then cleanup user data on screenarkaneConnect.logout({ windowMode: 'POPUP' }).then(() => {// Cleanup user data on screenhandleLogout();});
// Example 2// Log out and redirect to https://foo.ioarkaneConnect.logout({ windowMode: 'REDIRECT' , redirectUri: 'https://foo.io'});