From 875fc3aae00f8500c0cace20c9c283138eb39c1f Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 12 Sep 2019 15:06:04 +0200 Subject: [PATCH] Fix wrong routing state on initial page load --- client/src/app/core/core-services/openslides.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/app/core/core-services/openslides.service.ts b/client/src/app/core/core-services/openslides.service.ts index 2d6f31411..07d27a469 100644 --- a/client/src/app/core/core-services/openslides.service.ts +++ b/client/src/app/core/core-services/openslides.service.ts @@ -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']); + }); } }