How to properly delay a guard until angular knows the definitive session state
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 文件
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- angular, firebase, typescript
研究方向
未指定檔案、測試或進入點;該 issue 要求提供有關如何延遲 Angular route guards,直到 Firebase 驗證完成解析的指引。首先釐清 AngularFire API 或範例的預期範圍,接著記錄一個可重現的已驗證路由範例,並驗證在尚未解析的狀態期間不會發生重新導向。
由索引模型根據 Issue 內容生成。
描述
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 !
- 主要語言
- TypeScript
- 星號
- 7.8k
- 分支
- 2.2k
- 平均合併
- 2 天 21 小時
- 30 天內合併 PR
- 7
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
angular/angularfire 的其他 Issue
-
comp: schematics type: bug version: current (v17+)
難度 3/5 1-2 天 新手友好度 76/100
angular/angularfire#3768 · 1 則留言 ·
-
comp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 已指派 1 人 ·
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable 未關閉comp: core type: feature
angular/angularfire#3755 · 已指派 1 人 ·
-
comp: auth comp: ssr comp: zones type: bug version: current (v17+)
難度 3/5 1-2 天 新手友好度 76/100
angular/angularfire#3748 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
angular/angularfire#3737 · 1 則留言 · 22 個 reaction ·
查看 angular/angularfire 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 88/100
motiondivision/motion#3849 ·
-
check:passed streams:add
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 68/100
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
i-am-bee/beeai-framework#1697 · 1 個 reaction ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 75/100
antfu/node-modules-inspector#214 ·