ToCsvService to escape the fields during exportCsv.

Auth Interceptor to check for logged out user.
This commit is contained in:
tanshu
2018-06-11 22:14:04 +05:30
parent a811a121cc
commit 4530052a22
6 changed files with 84 additions and 34 deletions

View File

@ -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);
}