mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 09:26:14 -04:00
First attempt at making a logout feature
This commit is contained in:
parent
96234dff7b
commit
f5598fdb4e
8 changed files with 30 additions and 4 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue