315 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
46
views
Why does the canActivateChild guard on route gets called before canActivateChild guard on parent route?
When I navigate to SomeChildComponent, I wonder why SOME_CHILD_GUARD is called before SOME_PARENT_GUARD. It makes no sense to me. And I would like the order to be inverted.
I have not found anything ...
2
votes
1
answer
132
views
Angular | Why catchError does't catch 401 error?
Listen, I'll explain how it all happens.
I'm making a refresh system for a jwt token. It's a standard thing. I configured exactly two systems: guards and interceptors. That's why I'm sure people will ...
1
vote
1
answer
107
views
How to display loading indicator without flickering on redirection
I'm currently trying to display a loading indicator on navigation in Angular. The issue I am experiencing is that when the user is tries to get on a protected route, the guard will redirect them but ...
1
vote
1
answer
84
views
Microfrontend Architecture: Angular Guards
I have an application that uses a microfrontend architecture. In one specific microfrontend, I'm using Angular guards with the canDeactivate method. Here's an example:
const exampleRoutes: Routes = [
...
1
vote
1
answer
159
views
How to have a route guard that routes to an auxiliary route after passing?
I have a section of my Angular app that is only accessible through a generated link sent to the user's email (a Docusign type thing). It is sectioned off from the rest of the app via a feature module, ...
2
votes
2
answers
926
views
Angular Guard Issue with Server-Side Rendering (SSR)
I'm working on an Angular 17 project with login and session functionality. Everything is working well except for the guard. Every time I refresh the page, the screen briefly blinks back to the login ...
2
votes
1
answer
99
views
Angular auth bug guard and interceptor
I want to do token-based authorization with angular, but I have a bug like this
I can protect pages with auth guard if the token has not exploded, but I cannot use the interceptor because auth guard ...
0
votes
1
answer
89
views
Why interacting of two guards leads to infinite redirection loop in Angular 18?
I've got routes '/' and '/auth'. The logic is that NOT logged in users can access ONLY /auth page, while logged in users CAN'T access it.
So, I've made two guards and for some reason I get infinite ...
0
votes
2
answers
75
views
Common directive to detect for form value before any routing
I need to team suggestion , I have more than 10 form. I want create common directives or any other option form value change before routing. If form changed we need to get confirmation from ...
2
votes
0
answers
709
views
Angular devtools "Angular application not detected." with canActivate keycloak guard
The angular devtools plugin in firefox and chrome does not work and reports Angular application not detected. when the root path is guarded by a keycloak auth guard.
Reproduction steps:
Create a new ...
1
vote
1
answer
258
views
CoreUI with Angular 18 - interceptor not intercepting http requests
I just started with coreUi and Angular 18 and would like to intercept the requests, when the user calls another route. I started with the standard coreUi modern theme and set everything up so far but ...
1
vote
1
answer
257
views
Angular deep linking with JWT bearer token in authorization header
How can I get the incoming request headers in an Angular authentication guard?
In an Angular 17 application, I'd like to support authenticated deep links with JWT tokens in the incoming request header,...
0
votes
1
answer
799
views
Angular 17 and above: How to add a guard or protect empty path, redirectTo route
I am not able to add any guard or anything for redirectTo route in my case which is an empty path.
I am using MSAL for authentication, MSAL does provide a guard and its working for other routes.
So ...
0
votes
0
answers
75
views
Persisting user and user profile in Angular and data changes after consulting it
Yesterday I encountered a very peculiar bug which I have not been able to solve. I essentially created services to handle user authentication and data management. I also created an additional service ...
2
votes
0
answers
151
views
Cannot inject services into functional guard
We're trying to implement a functional guard but an error keeps occurring relating to the injected services.
Code: role.guard.ts:
import { HttpClient } from "@angular/common/http";
import { ...