mirror of
https://gitlab.com/comunic/comunicconsole
synced 2025-06-20 00:25:19 +00:00
Can sign out
This commit is contained in:
@ -89,4 +89,18 @@ export class AccountHelper {
|
||||
if (currentAccount == null) throw new Error("Current account is null!");
|
||||
return currentAccount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sign out current user
|
||||
*/
|
||||
static async signOut() {
|
||||
try {
|
||||
await serverRequest("accounts/sign_out");
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
sessionStorage.removeItem(SESSION_STORAGE_TOKEN);
|
||||
document.location.href = document.location.href + "";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user