$.udb.logout()
This article is about the logout() function of the udb object.
$.udb.logout()
Logs out.
Returns a UdbPromise object.
Syntax
$.udb.logout( 'reset' )
$.udb.logout( *logout-function* )
$.udb.logout( *options* )
.then(() => {
// success
})
.catch(() => {
// failure
})
.finally(() => {
// executed after success / failure is handled
});
*options* ::= {
[page]: *page-name*
}
The 'reset' string parameter resets the logout functionality to its original settings, overwriting any change done with the logout-function.
Logout-function is a function that modifies the behavior of the logout functionality. The framework uses this function to instrument SAML-based authentication, in this case by redirecting the logout functionality to the internal SAML logout endpoint.
Options is a struct that can have the following items, all of which are optional.
Page-name is a string that defines the page to navigate to after the logout succeeds.
Examples
$.udb.logout();
$.udb.logout({page:'MyGoodbyePage'});
$.udb.logout()
.then(function(){
alert('Goodbye!');
});
When single sign-on (SSO) is configured, logout()'s default implementation is replaced wholesale by UdbSSO.ssoLogout, which only redirects the browser to the SSO logout endpoint. In that case neither beforelogout nor logout fires. See the "Single sign-on (SSO)" section of beforelogout and logout for details.
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforelogout | Page objects | Before each logout action |
| logout | Page objects | After each logout action |