How to properly delay a guard until angular knows the definitive session state
- Ngôn ngữ chính
- TypeScript
- Star
- 7.8k
- Fork
- 2.2k
- Merge trung bình
- 22 giờ 28 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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 !
Hướng dẫn đóng góp
Hướng nghiên cứu
Không có tệp, bài kiểm thử hoặc điểm vào nào được nêu; issue yêu cầu hướng dẫn về việc trì hoãn Angular route guards cho đến khi quá trình xác thực Firebase được giải quyết. Trước tiên, hãy làm rõ phạm vi dự kiến của AngularFire API hoặc ví dụ, sau đó ghi lại một ví dụ có thể tái hiện về route đã xác thực và xác minh rằng nó không chuyển hướng trong trạng thái chưa được giải quyết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, firebase, typescript
- Lĩnh vực
- authentication, frontend
- Loại issue
- Tài liệu
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100