Skip to main content
Version: 11.2

$.udb.showLogin()

note

This article is about the showLogin() function of the udb object.

$.udb.showLogin()

Shows the login page, or changes how the login page is displayed.

If no parameter is passed, a UdbPromise object is returned.

Syntax

$.udb.showLogin( 'reset' )

$.udb.showLogin( [*options*] )
.then(() => {
// success
});

*options* ::= {
[useTopContext]: *use-top-context*,
[reset]: *reset-function*,
[show]: *show-function*
}

*use-top-context* ::= { true | [false] }

The .showLogin() function either takes the string value 'reset' which resets the currently options to its default values therefore resetting the .showLogin() functionality to its default behavior, or an options struct that can have the following items, all of which are optional.

Use-top-context is a boolean that defines if the login page must always be displayed in the top-level context, and not e.g. in the ApplicationFrame. This results in all embedded frames to be overriden and not existing anymore when the login page is displayed. Its default is false, which means the current active frame context is used.

Reset-function is a function that takes one parameter named reason, and is used to reset the login page in case a login has failed.

Show-function is a function that takes one parameter named reason, and is the function used to show the login page. If overridden, it may be used to alter the login behavior to e.g. show a login dialog instead, so that any data on the current page could be preserved if the re-login in the dialog was successful.

Omitting the options parameter will log out the user and show the login page and return a UdbPromise object.

Examples

$.udb.showLogin( {useTopContext: true} );
$.udb.showLogin( 'reset' );

.showLogin() does not directly trigger any named UDB event itself. Its default behavior, if the user is currently logged in, is to call $.udb.logout() as a separate operation � which is what triggers beforelogout and logout � rather than triggering those events directly. Also note the relationship runs the other way for timeout: the timeout event is what causes $.udb.showLogin() to be called by default (see .setTimeout()), not the reverse. �