Indicated that you are logged by coloring the icon in orange and disconnect if clicked on it

This commit is contained in:
tonitch committed 2024-03-16 13:56:29 +01:00
1 parent 847936b799
commit 04f64f505e
3 files changed
+20 -4

No files matched your search

+9
View File
@@ -1,9 +1,18 @@
import { restGet, restPost } from './restConsumer.js'
import { getCookie, setCookie } from '@/utils.js'
export async function login(user, pass, exp){
return restPost("/login", {identifier: user, password: pass, expirationDate: exp});
}
export function isLogged(){
return getCookie("session_token") != ""
}
export function disconnect(){
setCookie("session_token", ";expires= Thu, 01 Jan 1970 00:00:01 GMT")
}
/**
* Register a user (tokenless)
*