angular / angular/angularfire

How to properly delay a guard until angular knows the definitive session state

Offen
#3,656 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
7.8k
Forks
2.2k
Ø Merge
22 Std. 28 Min.
Gemergte PRs (30 T.)
6

Beschreibung

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 !

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Keine Datei, kein Test und kein Einstiegspunkt werden genannt; das Issue bittet um Hinweise dazu, wie Angular route guards verzögert werden können, bis die Firebase-Authentifizierung aufgelöst ist. Kläre zunächst den erwarteten Umfang der AngularFire API oder des Beispiels und dokumentiere anschließend ein reproduzierbares Beispiel für eine authentifizierte Route. Verifiziere, dass während des noch nicht aufgelösten Zustands keine Weiterleitung erfolgt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, firebase, typescript
Bereich
authentication, frontend
Issue-Typ
Dokumentation
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.