[auth] fix auth not being cleared after logout
This commit is contained in:
parent
3321ae0f1f
commit
b8222bff43
@ -42,8 +42,13 @@ export class MenuComponent implements OnInit {
|
||||
}
|
||||
|
||||
logout(): void {
|
||||
this.apiService.logout$().subscribe();
|
||||
this.loggedOut.emit(true);
|
||||
this.apiService.logout$().subscribe(() => {
|
||||
this.loggedOut.emit(true);
|
||||
if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) {
|
||||
this.userMenuGroups$ = this.apiService.getUserMenuGroups$();
|
||||
this.router.navigateByUrl('/');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onLinkClick() {
|
||||
|
@ -368,7 +368,7 @@ export class ApiService {
|
||||
return of(null);
|
||||
}
|
||||
|
||||
localStorage.setItem('auth', null);
|
||||
localStorage.removeItem('auth');
|
||||
return this.httpClient.post(`${SERVICES_API_PREFIX}/auth/logout`, {
|
||||
headers: { 'Authorization': auth.token }
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user