Setting Persistence Doesn't Work
- 主要言語
- TypeScript
- スター
- 7.8k
- フォーク
- 2.2k
- 平均マージ
- 22時間 28分
- マージ済み PR(30日)
- 6
説明
Currently running `setPersistence` with any `Persistence` breaks. I was able to work around this by just importing `setPersistence` from `@firebase/auth` instead of `@angular/fire/auth`.
### Version info
**Angular:** 13.1.3
**Firebase:** 9.6.4
**AngularFire:** 7.2.0
**Other (e.g. Ionic/Cordova, Node, browser, operating system):** Node 17.x; OS Windows 11; Browser Chrome;
### How to reproduce these conditions
Try setting persistance:
```ts
setPersistence(this.auth, browserSessionPersistence).catch(console.error);
```
### Debug output
```
TypeError: Class constructor BrowserSessionPersistence cannot be invoked without 'new'
at angular-fire.js:206:29
at angular-fire.js:163:45
at ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25457:1)
at ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)
at NgZone.run (core.mjs:25311:1)
at run (angular-fire.js:163:35)
at new (angular-fire.js:206:16)
at _getInstance (index-bc414788.js:535:16)
```
### Expected behavior
Setting persistence works.
### Actual behavior
Setting persistence doesn't work.
コントリビューションガイド
調査の方向性
まず、AngularFire 7.2.0 で issue に記載されている `setPersistence(this.auth, browserSessionPersistence)` の呼び出しを再現し、次に `@firebase/auth` から `setPersistence` をインポートする場合と比較します。`BrowserSessionPersistence` コンストラクターエラーが発生せず、`@angular/fire/auth` 経由で永続性が機能すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, firebase, typescript
- 領域
- authentication
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100