Indicated that you are logged by coloring the icon in orange and disconnect if clicked on it
This commit is contained in:
@ -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)
|
||||
*
|
||||
|
Reference in New Issue
Block a user