[ACA-1589] fix auth redirects when ticket expires (#529)

This commit is contained in:
Denys Vuika
2018-07-23 19:33:05 +01:00
committed by GitHub
parent 2441dadc84
commit 9676bf6f79
2 changed files with 5 additions and 2 deletions

View File

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

View File

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