$.udb.login()
This article is about the login() function of the $.udb object.
$.udb.login()
Logs in.
Returns a UdbPromise object.
Syntax
$.udb.login( *user*, *password*, [options] )
*options* ::= {
[page]: *page-name*
}
The required user is a string that identifies the user. The required password is a string that defines the password.
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 display if the login succeeds.
Examples
$.udb.login('ABC', 'DEF');
$.udb.login('ABC', 'DEF', { page: 'MyFirstPage' })
.then(() => {
// executed on 'MyFirstPage'
})
.catch((() => {
// the login was not successful
});
.finally(() => {
// executed after success / failure is handled
});
$.udb.login('ABC', 'DEF')
.then(() => {
alert('Welcome!');
});
The beforelogin event only fires for the initial submission of credentials (user name and password). If the application calls $.udb.login({ checkCode: code }) to submit a multi-factor authentication (MFA) code, or if single sign-on (SSO) is configured, beforelogin (and, for SSO, login) does not fire. See the "Multi-factor authentication and SSO" section of beforelogin for details.
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforelogin | Page objects | Before each login action |
| login | Page objects | After each login action |