105. Load token from local storage (#12)

This commit is contained in:
Art
2021-09-12 12:34:25 +03:00
parent 7fa45008ee
commit 5bcfd8d7bf

View File

@ -44,6 +44,10 @@ export class AuthenticationService {
this.storage.setItem(JWT_TOKEN_STORAGE_KEY, token);
}
public loadToken(): void {
this.token = this.storage.getItem(JWT_TOKEN_STORAGE_KEY);
}
public addUserToLocalStorage(user: User) {
this.storage.setItem(USER_STORAGE_KEY, JSON.stringify(user));
}