[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 { |   logout(): void { | ||||||
|     this.apiService.logout$().subscribe(); |     this.apiService.logout$().subscribe(() => { | ||||||
|       this.loggedOut.emit(true); |       this.loggedOut.emit(true); | ||||||
|  |       if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) { | ||||||
|  |         this.userMenuGroups$ = this.apiService.getUserMenuGroups$(); | ||||||
|  |         this.router.navigateByUrl('/'); | ||||||
|  |       } | ||||||
|  |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   onLinkClick() { |   onLinkClick() { | ||||||
|  | |||||||
| @ -368,7 +368,7 @@ export class ApiService { | |||||||
|       return of(null); |       return of(null); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     localStorage.setItem('auth', null); |     localStorage.removeItem('auth'); | ||||||
|     return this.httpClient.post(`${SERVICES_API_PREFIX}/auth/logout`, { |     return this.httpClient.post(`${SERVICES_API_PREFIX}/auth/logout`, { | ||||||
|       headers: { 'Authorization': auth.token } |       headers: { 'Authorization': auth.token } | ||||||
|     }); |     }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user