refactor(client): token helper

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2025-12-24 19:48:01 +08:00
committed by Asai Neko
parent 634c922903
commit 1d387a33c5
2 changed files with 21 additions and 2 deletions

15
client/src/lib/token.ts Normal file
View File

@@ -0,0 +1,15 @@
export function setToken(token: string) {
localStorage.setItem('token', token);
}
export function getToken() {
return localStorage.getItem('token');
}
export function removeToken() {
localStorage.removeItem('token');
}
export function hasToken() {
return getToken() !== null;
}