First attempt at making a logout feature

This commit is contained in:
harshil05133 2025-02-17 20:40:43 -05:00
parent 96234dff7b
commit f5598fdb4e
8 changed files with 30 additions and 4 deletions

View file

@ -392,6 +392,17 @@ exports.padeditbar = new class {
window.location.href = '/';
});
this.registerCommand('logout', () => {
console.log('Logout button clicked');
// Clear session or authentication token
fetch('/logout', { method: 'POST' })
.then(response => {
if (response.ok) {
window.location.href = '/'; // Redirect to the home page
}
});
});
this.registerCommand('embed', () => {
this.setEmbedLinks();
this.toggleDropDown('embed');