[ACA-2195] fix redirect on login after page reload (#997)

This commit is contained in:
Suzana Dirla 2019-03-05 18:14:26 +02:00 committed by Denys Vuika
parent 52bb48c825
commit 4fde215fad

View File

@ -81,8 +81,14 @@ export class AppComponent implements OnInit, OnDestroy {
if (error.status === 401) {
if (!this.authenticationService.isLoggedIn()) {
this.store.dispatch(new CloseModalDialogsAction());
let redirectUrl = this.route.snapshot.queryParams['redirectUrl'];
if (!redirectUrl) {
redirectUrl = this.router.url;
}
this.router.navigate(['/login'], {
queryParams: { returnUrl: 'personal-files' }
queryParams: { redirectUrl: redirectUrl }
});
}
}