ebs.auth.logout
Logs out the current user and redirects to the login screen. Optionally, it can redirect the user to a specified page upon re-login.
Syntax
Copy
ebs.auth.logout(customRedirect?: string): Promise<void>;
| Parameter | Type | Description |
|---|---|---|
customRedirect
(optional) |
string | URL to redirect the user to after logging back in. |
Response
Returns a void promise object, allowing you to associate handlers in case of success of failure.
Example
In this example
- We use the ebs.getBaseUrl to retrieve the platform core URL and construct the address that links to the d6d99364-7753-4177-925c-6f87ff4014d2 custom action, which we store in the redirectUrl variable.
- We re-authenticate the user, then redirect him to the custom action.
Copy
var redirectUrl = `${ebs.getBaseUrl()}/customaction/d6d99364-7753-4177-925c-6f87ff4014d2`;
ebs.auth.logout(redirectUrl);