Merge pull request #5010 from FinnStutzenstein/fixWrongRoutingState

Fix wrong routing state on initial page load
This commit is contained in:
Emanuel Schütze 2019-09-12 16:26:48 +02:00 committed by GitHub
commit db7f68ab6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -98,7 +98,12 @@ export class OpenSlidesService {
if (!this.redirectUrl || !this.redirectUrl.includes('/login/')) {
// Goto login, if the user isn't on a subpage like
// legal notice or reset passwort view.
this.router.navigate(['/login']);
// If other routing requests are active (e.g. to `/` or `/error`)
// wait for the authguard to finish to navigate to /login. This
// redirect is more important than the other ones.
setTimeout(() => {
this.router.navigate(['/login']);
});
}
}