Add lock files for package management and update architecture documentation
- Introduced bun.lock and package-lock.json to manage dependencies for the project. - Enhanced backend API architecture documentation with additional security and documentation guidelines. - Made minor formatting adjustments across various files for consistency and clarity.
This commit is contained in:
37
frontend-web/src/lib/api/token.ts
Normal file
37
frontend-web/src/lib/api/token.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Token Storage Utilities
|
||||
*/
|
||||
|
||||
const TOKEN_KEY = 'auth_token';
|
||||
const USER_KEY = 'auth_user';
|
||||
|
||||
export const tokenStorage = {
|
||||
getToken(): string | null {
|
||||
return localStorage.getItem(TOKEN_KEY);
|
||||
},
|
||||
|
||||
setToken(token: string): void {
|
||||
localStorage.setItem(TOKEN_KEY, token);
|
||||
},
|
||||
|
||||
removeToken(): void {
|
||||
localStorage.removeItem(TOKEN_KEY);
|
||||
},
|
||||
|
||||
getUser(): string | null {
|
||||
return localStorage.getItem(USER_KEY);
|
||||
},
|
||||
|
||||
setUser(user: string): void {
|
||||
localStorage.setItem(USER_KEY, user);
|
||||
},
|
||||
|
||||
removeUser(): void {
|
||||
localStorage.removeItem(USER_KEY);
|
||||
},
|
||||
|
||||
clear(): void {
|
||||
this.removeToken();
|
||||
this.removeUser();
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user