Skip to content

Commit

Permalink
[Issue #245] Allow multiple browser tabs to share one login session.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpierce committed Jun 21, 2020
1 parent 556ee18 commit 3fbb572
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions comixed-frontend/src/app/user/services/token.service.ts
Expand Up @@ -25,16 +25,16 @@ export class TokenService {
constructor() {}

signout(): void {
window.sessionStorage.removeItem(TOKEN_KEY);
window.sessionStorage.clear();
window.localStorage.removeItem(TOKEN_KEY);
window.localStorage.clear();
}

saveToken(token: string): void {
window.sessionStorage.removeItem(TOKEN_KEY);
window.sessionStorage.setItem(TOKEN_KEY, token);
window.localStorage.removeItem(TOKEN_KEY);
window.localStorage.setItem(TOKEN_KEY, token);
}

getToken(): string {
return sessionStorage.getItem(TOKEN_KEY);
return localStorage.getItem(TOKEN_KEY);
}
}

0 comments on commit 3fbb572

Please sign in to comment.