[accelerator] refresh auth state when logging out
This commit is contained in:
@@ -5,6 +5,7 @@ import { StorageService } from '../../services/storage.service';
|
||||
import { Router, NavigationStart } from '@angular/router';
|
||||
import { StateService } from '../../services/state.service';
|
||||
import { IUser, ServicesApiServices } from '../../services/services-api.service';
|
||||
import { AuthServiceMempool } from '../../services/auth.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-menu',
|
||||
@@ -26,7 +27,8 @@ export class MenuComponent implements OnInit, OnDestroy {
|
||||
private servicesApiServices: ServicesApiServices,
|
||||
private storageService: StorageService,
|
||||
private router: Router,
|
||||
private stateService: StateService
|
||||
private stateService: StateService,
|
||||
private authService: AuthServiceMempool
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -61,6 +63,7 @@ export class MenuComponent implements OnInit, OnDestroy {
|
||||
this.loggedOut.emit(true);
|
||||
if (this.stateService.env.GIT_COMMIT_HASH_MEMPOOL_SPACE) {
|
||||
this.userMenuGroups$ = this.servicesApiServices.getUserMenuGroups$();
|
||||
this.authService.logout();
|
||||
if (window.location.toString().includes('services')) {
|
||||
this.router.navigateByUrl('/login');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user