Files
aman-frontend/src/services/session.ts

34 lines
756 B
TypeScript

export class Session {
static resetBearerToken(): void {
localStorage.removeItem('token');
}
static setBearerToken(token: string): void {
localStorage.setItem('token', token);
}
static bearerToken(): string | null {
return localStorage.getItem('token');
}
static setTheme(theme: string) {
localStorage.setItem('theme', theme);
}
static theme(): string | null {
return localStorage.getItem('theme');
}
static resetLastShownComponent(): void {
localStorage.removeItem('path');
}
static setLastShownComponent(path: string): void {
localStorage.setItem('path', path);
}
static lastShownComponent(): string | null {
return localStorage.getItem('path');
}
}