Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
41 views

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 ...
JTHOUMEL's user avatar
2 votes
1 answer
117 views

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 ...
Андрій Степанов's user avatar
1 vote
1 answer
98 views

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 ...
user p's user avatar
  • 69
1 vote
1 answer
77 views

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 = [ ...
camil's user avatar
  • 81
1 vote
1 answer
155 views

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, ...
Alex Davis's user avatar
2 votes
2 answers
876 views

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 ...
BigChat88's user avatar
2 votes
1 answer
89 views

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 ...
Erenb's user avatar
  • 21
0 votes
1 answer
86 views

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 ...
ADEXITUM's user avatar
0 votes
2 answers
72 views

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 ...
CMS Develop's user avatar
2 votes
0 answers
690 views

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 ...
T_01's user avatar
  • 1,413
1 vote
1 answer
256 views

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 ...
Sithys's user avatar
  • 3,801
1 vote
1 answer
245 views

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,...
Jan Nielsen's user avatar
0 votes
1 answer
780 views

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 ...
Eternal Sunshine's user avatar
0 votes
0 answers
70 views

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 ...
App Scripter's user avatar
2 votes
0 answers
149 views

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 { ...
Ryan Penfold's user avatar
3 votes
0 answers
127 views

I’m attempting to add an unsaved popup modal in my component. I’ve used lazy loading to load modules, and after that, I’m loading standalone components. However, I’ve encountered an issue: when ...
Muhammad Usman's user avatar
1 vote
1 answer
548 views

I have a guard that needs to get something async and then decide with that value if a user needs to be redirected with the URLTree. The code itself is very simple: export const otapGuard: ...
YhEtesian's user avatar
2 votes
1 answer
202 views

After login router.navigate goes to guard but in guard it doesn't get updated value. My app.config.ts is: export const appConfig: ApplicationConfig = { providers: [ provideRouter(routes), ...
Faisal ahmed's user avatar
0 votes
0 answers
58 views

The guard I shared below controls access to routes based on the user's role. Since we started using this guard, whenever we refresh pages in the browser or try to load pages with URL information, it ...
Asdf's user avatar
  • 1
1 vote
3 answers
358 views

I have a canDeactivateGuard which returns from component's MatDialog for unsaved action. My problem is I am unable to test the functional guard and getting error - TypeError: Cannot read properties of ...
ufccoder's user avatar
0 votes
1 answer
216 views

enter image description here As you can see in the uploaded image, I have everything good imported as it should be when using httpClient, but i get this error when going to the route where I use my ...
Alex Whitney's user avatar
0 votes
1 answer
1k views

I am trying to trying to implement Guards for lazy loaded components. I have tried canMatch and canActivate for which I am getting the error. Cannot match any routes. URL Segment: 'admin/home/all-...
themadhatter's user avatar
1 vote
2 answers
4k views

I have defined my routes as follows: import { Routes } from '@angular/router'; import { domainGuard } from './guard-routes.service'; import { NotFoundComponent } from './notFound/not-found.component'; ...
amir tbi's user avatar
  • 600
0 votes
1 answer
2k views

I am migrating old angular project to latest angular 17. I changed class based auth guard to functional auth guard. The problem I am having is that I get this error: ERROR NullInjectorError: ...
Silko's user avatar
  • 622
0 votes
1 answer
63 views

I'm working on a new project using Angular & Firebase Auth + Firestore DB, and I noticed a problem in my implementation but I've ran out of ideas what it could cause this. I created an Admin Guard ...
Alex Andrei's user avatar
0 votes
1 answer
2k views

I want to prevent navigation by changing the URL and only navigate on button click. My code: import {Injectable} from '@angular/core'; import {CanActivateFn, Router} from '@angular/router'; @...
Abhirup Das's user avatar
1 vote
1 answer
96 views

I have a simple Angular functional route guard that retrieves a boolean value from a Subject<boolean> property on a service. The guard seems to work as expected and looks like this: export const ...
ebhh2001's user avatar
  • 2,136
-1 votes
1 answer
1k views

I would like to ask, how I can create the role based system in Angular. In my application, I have created the class app-routing.ts, where i would like to define ClientComponent can open only the ...
Marek Vondra's user avatar
0 votes
1 answer
489 views

Hi everyone I'm struggling with this error on my webapp and I followed the suggestion on the old topic but I still have the error. Here is my code. When I try to go on dashboard I receive a blank page ...
Studio Forma's user avatar
7 votes
1 answer
4k views

I'm implementing a functional router guard in Angular 15.2.9 which checks if a user is logged in. When this is not the case, the guard should return either false or a UrlTree (i.e. redirect to login ...
Florian Gössele's user avatar
1 vote
1 answer
324 views

I'm encountering an issue with my Angular application where the AuthGuard isn't recognizing a session cookie named 'sessionId' correctly. I have implemented user authentication, and the expected ...
dkobzar's user avatar
  • 77
0 votes
1 answer
1k views

I am trying to test Angular functional guard with Jest as a testing framework. For mocking the Router component I am using Angular RouterTestingHarness. Here is my functional guard (I can't edit or ...
Hargun Singh's user avatar
0 votes
1 answer
166 views

Since the old method for Angular Guards (Class and injection token guards and resolvers) is deprecated (see angular deprecation docs) , I'm trying to update the usages of guards in my project. But I'm ...
Ghonche Yqr's user avatar
4 votes
1 answer
4k views

I am in Authenticate with authGuard. I would like to know the difference between these two // Redirect to the login page return router.navigate(['/login']); return router.parseUrl('/login'); In ...
Pamba's user avatar
  • 832
0 votes
1 answer
767 views

Good morning community I am new to micro frontend, currently I am building an application where all the microfrontends are made in angular and i am using the single-spa plugin to display them. What I ...
damanchola's user avatar
1 vote
0 answers
517 views

I was using CanActivate, but I recently migrated to Angular 16 and since it is deprecated, I tried to use inject() as guided by the official documentation. This is how my routing component looks like: ...
Rahul Roy's user avatar
  • 407
0 votes
1 answer
105 views

I have just deployed my Angular project inside a Docker Container. Path for me to access to the site is: localhost:4200, because on my machine is listening on 4200, but inside the container is ...
ShadyRaso's user avatar
0 votes
0 answers
139 views

I have built an angular website with a bootstrap navbar, where I use the [routerLinkActive] in order to highlight the links which indicate where the user is right now. The navlinks which don't route ...
Pieterjan's user avatar
  • 3,709
0 votes
1 answer
1k views

I would like to implement a CanDeactivate Guard in my Ionic Angular application. I've found out, that I should use the new "CanDeactivateFn" Guard, but I can't found any information or an ...
KTSB's user avatar
  • 111
0 votes
1 answer
2k views

I am developing a small project using Angular, Nodejs, Express, MySQL. In the project there is 2 type of user, customer user and contractor user. I am having difficulty in using CanActivate to guard ...
HengHeng123's user avatar
2 votes
0 answers
924 views

MSAL library is used with Angular 15, every controller is protected with the MsalGuard in the app-routing file as follows: const routes: Routes = [ { path: 'protected-component', component: ...
Semen Shekhovtsov's user avatar
15 votes
6 answers
34k views

How can I make use of the latest CanActivateFn in Angular 16 with DI? The recent Angular 16 uses a function, not a class, for the canactivate functionality. This is my code below. How can I add my DI'...
Joseph Chikeme's user avatar
3 votes
1 answer
3k views

I'm using the angular-oauth-oidc library to manage authentication in an angular app. I'm also using this sample as the base for my work: https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-...
Waray Mohamed Amine's user avatar
2 votes
2 answers
4k views

I have an angular app with Angular 15. App-routing module somehow doesn't redirect, when a guard returns the UrlTree. app-routing.module.ts import { NgModule } from '@angular/core'; import { ...
Maestro's user avatar
  • 45
0 votes
1 answer
848 views

I am working with Angular 15 and I am trying to use the routing resolver handler to prefetch products before loading a product-list component. This product-list component simply displays the products. ...
idash's user avatar
  • 29
1 vote
1 answer
2k views

I would like to block URL access from unauthorized users. I'm currently using canActivate with route Guard from angular to block users to access /my/specific_url_route. Indeed, I want to block some ...
Dorian's user avatar
  • 37
0 votes
1 answer
425 views

I would like to block url access from unauthorized users. I'm currently using canActivate with route Guard from angular for blocking no Admin user to access /admin route (that's works OK). But now, I ...
Dorian's user avatar
  • 37
0 votes
1 answer
452 views

Hello Stack community, Is there a efficient way of handling errors throwed inside one of following: canActivate canActivateChild canDeactivate canMatch resolve canLoad While Angular navigation? ...
Tomas's user avatar
  • 3,475
2 votes
1 answer
1k views

I use new functional guards like: export function AuthGuard() { const route = inject(ActivatedRoute); const authService = inject(AuthService); return authService.state$.subscribe((user) => { ...
Konstantin Grig's user avatar
2 votes
1 answer
6k views

I'm trying to configure a set of routes where the top level URL in a module should redirect users to an alternate path in the same module based on their current permissions. I think I should be able ...
joelghill's user avatar

1
2 3 4 5
7