ToCsvService to escape the fields during exportCsv.
Auth Interceptor to check for logged out user.
This commit is contained in:
@ -20,8 +20,19 @@ export class HttpAuthInterceptor implements HttpInterceptor {
|
||||
.pipe(
|
||||
catchError((err: any, caught: Observable<any>): ObservableInput<{}> => {
|
||||
if (err.status === 401) {
|
||||
this.router.navigate(['login']);
|
||||
this.toaster.show('Danger', 'User has been logged out');
|
||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||
width: '250px',
|
||||
data: {
|
||||
title: 'Logged out!',
|
||||
content: 'You have been logged out.\nYou can press Cancel to stay on page and login in another tab to resume here, or you can press Ok to navigate to the login page.'
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().subscribe((result: boolean) => {
|
||||
if (result) {
|
||||
this.router.navigate(['login']);
|
||||
}
|
||||
});
|
||||
}
|
||||
return observableOf(caught);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user