Last active
September 2, 2021 05:19
-
-
Save hieptl/5179fa977a96c88edd87735fbfee589a to your computer and use it in GitHub Desktop.
Index.js - Logout - Javascript Chat App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
logoutButon.addEventListener('click', function() { | |
const isLeaved = confirm('Do you want to log out?'); | |
if (isLeaved) { | |
// logout from cometchat and then clear storage. | |
CometChatWidget.logout().then(response => { | |
// User successfully logged out. | |
// Perform any clean up if required. | |
// redirect to login page. | |
window.location.href = '/login.html'; | |
}); | |
} | |
}); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment