How to properly delay a guard until angular knows the definitive session state
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- angular, firebase, typescript
- Ambito
- authentication, frontend
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.
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<User | null | undefined> 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 !
- Lingua principale
- TypeScript
- Stelle
- 7.8k
- Fork
- 2.2k
- Merge medio
- 22h 34m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di angular/angularfire
-
comp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 1 assegnatario ·
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable Apertacomp: core type: feature
angular/angularfire#3755 · 1 assegnatario ·
-
comp: auth comp: ssr comp: zones type: bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
angular/angularfire#3748 ·
-
Angular 22 release please Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
angular/angularfire#3737 · 17 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
angular/angularfire#3715 ·