fix(ui): Force page reload on logout (#1870)
This commit is contained in:
@@ -73,7 +73,6 @@ function handle401Error(authService: AuthService, request: HttpRequest<any>, nex
|
|||||||
}
|
}
|
||||||
|
|
||||||
function forceLogout(authService: AuthService, router: Router, message?: string): void {
|
function forceLogout(authService: AuthService, router: Router, message?: string): void {
|
||||||
authService.logout();
|
|
||||||
router.navigate(['/login']);
|
|
||||||
if (message) console.warn(message);
|
if (message) console.warn(message);
|
||||||
|
authService.logout();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,6 +73,5 @@ export class ChangePasswordComponent {
|
|||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
this.authService.logout();
|
this.authService.logout();
|
||||||
window.location.href = '/login';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,9 @@ export class AuthService {
|
|||||||
this.oAuthStorage.removeItem("id_token");
|
this.oAuthStorage.removeItem("id_token");
|
||||||
this.tokenSubject.next(null);
|
this.tokenSubject.next(null);
|
||||||
this.getRxStompService().deactivate();
|
this.getRxStompService().deactivate();
|
||||||
this.router.navigate(['/login']);
|
|
||||||
|
// Force reload so user's data is not cached for next user that logs in
|
||||||
|
window.location.href = '/login';
|
||||||
}
|
}
|
||||||
|
|
||||||
getRxStompService(): RxStompService {
|
getRxStompService(): RxStompService {
|
||||||
|
|||||||
Reference in New Issue
Block a user