The user's username
The user's password
Error if bad credentials or server error.
const userLogin = "jdo@mycompany.com"
const userPassword = "xxx"
// Open a new user session, and get back user data from server
JMap.User
.login(userLogin, userPassword)
.then(sessionData => {
console.log(`User ${userLogin} has been authenticated, his session token is "${sessionData.accessToken}"`)
})
.catch(errorKey => {
console.error(`Cannot loggin ${userLogin}, errorKey="${errorKey}"`, error)
})
JMap.User.login
The login function, returns a promise. Makes a call to the server and if login is successful resolve the promise providing the user session data.
If an error occurs, 3 differents string message can be returned :