All of these events are triggered from the local client.
Triggered when a user successfully logs in. The callback receives the authentication token.
client.auth().on("login", token => { /* Store token for future use. */ });
Triggered when a new user registers successfully. The callback receives the user details.
client.auth().on("register", token => { /* Store token for future use. */ });
Triggered when the user logs out. No parameters are passed.
client.auth().on("logout", () => { /* Redirect to another page (e.g., the home page) */ });