We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c106688 commit 99242caCopy full SHA for 99242ca
1 file changed
src/app/core/authentication/guard/logged-in.guard.ts
@@ -1,5 +1,5 @@
1
import { inject } from '@angular/core';
2
-import { Router } from '@angular/router';
+import { ActivatedRoute, Router } from '@angular/router';
3
import { SecurityContainer } from '../services/security-container.service';
4
5
/**
@@ -19,7 +19,9 @@ export const LoggedInGuard = () => {
19
} else {
20
// Not logged in
21
// Redirect to login
22
- router.navigate([loginRoute], { queryParams: { returnUrl: router.routerState.snapshot.url } });
+ if (router.routerState.snapshot.url.split('?')[0] !== loginRoute) {
23
+ router.navigate([loginRoute], { queryParams: { returnUrl: router.routerState.snapshot.url } });
24
+ }
25
active = false;
26
}
27
0 commit comments