This commit is contained in:
2024-05-02 16:58:01 +01:00
parent 29b69deaf6
commit 7d346ba2ce
3 changed files with 18 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import { goto } from '$app/navigation';
import { rdelete } from '$lib/requests.svelte';
type User = {
token: string;
@@ -33,6 +34,10 @@ export function createUserStore() {
if (value) {
localStorage.setItem('user', JSON.stringify(value));
} else {
if (user) {
// Request the deletion of the token
rdelete('/user/token/logoff', {});
}
localStorage.removeItem('user');
}
user = value;