How to properly delay a guard until angular knows the definitive session state
- Langage dominant
- TypeScript
- Étoiles
- 7.8k
- Forks
- 2.2k
- Merge moyen
- 22 h 28 min
- PR mergées (30 j)
- 6
Description
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 !
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Aucun fichier, test ou point d’entrée n’est nommé ; l’issue demande des indications sur la manière de retarder Angular route guards jusqu’à la résolution de l’authentification Firebase. Commencez par clarifier la portée attendue de l’API ou de l’exemple AngularFire, puis documentez un exemple reproductible de route authentifiée et vérifiez qu’aucune redirection n’a lieu pendant l’état non résolu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, firebase, typescript
- Domaine
- authentication, frontend
- Type d'issue
- Documentation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100