Restructure backend into modular API layers with admin/organizador/invitados routes, add role-based middleware, flatten module models, and update build scripts
This commit is contained in:
17
packages/admin/src/lib/auth.ts
Normal file
17
packages/admin/src/lib/auth.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
const TOKEN_KEY = "planner_admin_token";
|
||||
|
||||
export function getToken() {
|
||||
return localStorage.getItem(TOKEN_KEY);
|
||||
}
|
||||
|
||||
export function setToken(token: string) {
|
||||
localStorage.setItem(TOKEN_KEY, token);
|
||||
}
|
||||
|
||||
export function clearToken() {
|
||||
localStorage.removeItem(TOKEN_KEY);
|
||||
}
|
||||
|
||||
export function isLoggedIn() {
|
||||
return Boolean(getToken());
|
||||
}
|
||||
Reference in New Issue
Block a user