How to properly delay a guard until angular knows the definitive session state
- Lingua principale
- TypeScript
- Stelle
- 7.8k
- Fork
- 2.2k
- Merge medio
- 22h 28m
- PR unite (30g)
- 6
Descrizione
Angular 19
Hi, I have been playing around learning how to protect some routes with authentication
my problem is that the user state takes a moment to properly notify the final resolution
meaning that, if a user is authenticated and access to a protected route, the user state returns null and then the user, breaking the protection
I have been trying different techniques like BehaviorSubject and filtering the undefined state to know that firebase still didn't provide a final state
I have also found a guy getting the session from the cookies https://medium.com/@ignatovich.dm/securing-angular-applications-with-route-guards-and-firebase-auth-54c02bdd4811 it is sync and with a straight answer
if I could find some examples for these use cases I will appreciate !
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Non viene indicato alcun file, test o punto di ingresso; l’issue chiede indicazioni su come ritardare Angular route guards finché l’autenticazione Firebase non viene risolta. Chiarisci innanzitutto l’ambito previsto dell’API o dell’esempio AngularFire, quindi documenta un esempio riproducibile di route autenticata e verifica che non venga eseguito alcun reindirizzamento durante lo stato non risolto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, firebase, typescript
- Ambito
- authentication, frontend
- Tipo di issue
- Documentazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100