parent
c1615a0b82
commit
cbc36757dc
@ -1,23 +1,22 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LocalStorageService {
|
||||
private readonly AUTH_TOKEN_KEY = 'auth_token';
|
||||
|
||||
private readonly AUTH_TOKEN_KEY = 'auth_token';
|
||||
constructor() {}
|
||||
|
||||
constructor() { }
|
||||
setToken(token: string): void {
|
||||
localStorage.setItem(this.AUTH_TOKEN_KEY, token);
|
||||
}
|
||||
|
||||
setToken(token: string): void {
|
||||
localStorage.setItem(this.AUTH_TOKEN_KEY, token);
|
||||
}
|
||||
getToken(): string | null {
|
||||
return localStorage.getItem(this.AUTH_TOKEN_KEY);
|
||||
}
|
||||
|
||||
getToken(): string | null {
|
||||
return localStorage.getItem(this.AUTH_TOKEN_KEY);
|
||||
}
|
||||
|
||||
removeToken(): void {
|
||||
localStorage.removeItem(this.AUTH_TOKEN_KEY);
|
||||
}
|
||||
}
|
||||
removeToken(): void {
|
||||
localStorage.removeItem(this.AUTH_TOKEN_KEY);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue