diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 90a9c9a62..9d3f99ab8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -68,6 +68,7 @@ export class AppComponent implements OnInit { this.alfrescoApiService.getInstance().on('error', error => { if (error.status === 401) { if (!this.authenticationService.isLoggedIn()) { + this.authenticationService.setRedirect({ provider: 'ECM', url: this.router.url }); this.router.navigate(['/login']); } } diff --git a/src/app/components/preview/preview.component.ts b/src/app/components/preview/preview.component.ts index 572e29dca..c007477f0 100644 --- a/src/app/components/preview/preview.component.ts +++ b/src/app/components/preview/preview.component.ts @@ -117,8 +117,10 @@ export class PreviewComponent extends PageComponent implements OnInit { return; } this.router.navigate([this.previewLocation, id]); - } catch { - this.router.navigate([this.previewLocation, id]); + } catch (err) { + if (!err || err.status !== 401) { + this.router.navigate([this.previewLocation, id]); + } } } }