mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Ensure logout link still redirects to login page after session time-out
Refs #653
This commit is contained in:
@@ -75,7 +75,16 @@ export class AppComponent {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.auth.logout()
|
this.auth.logout()
|
||||||
.subscribe(
|
.subscribe(
|
||||||
() => this.router.navigate(['/login'])
|
() => {
|
||||||
|
this.router.navigate(['/login']);
|
||||||
|
},
|
||||||
|
($event: any) => {
|
||||||
|
if ($event && $event.response && $event.response.status === 401) {
|
||||||
|
this.router.navigate(['/login']);
|
||||||
|
} else {
|
||||||
|
console.error('An unknown error occurred while logging out', $event);
|
||||||
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user