This event is triggered when the user session has changed.
If it's a logout, the accessToken in params.session is equal to "-1".
example
// Each time the session has changed this method is processed
JMap.Event.User.on.sessionChanged(
"custom-session-change",
params => {
if (params.session.accessToken === "-1") {
console.log("Session has been closed", params.session)
} else {
console.log(`New session opened`, params.session)
}
}
)
Parameters
listenerId: string
Your listener id (must be unique for all user events)
JMap.Event.User.on
Here you have all available user events on which you can attach a listener.