Setting Persistence Doesn't Work
- Linguagem predominante
- TypeScript
- Estrelas
- 7.8k
- Forks
- 2.2k
- Merge médio
- 22h 28min
- PRs com merge (30d)
- 6
Descrição
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.
Guia de contribuição
Direção de pesquisa
Comece reproduzindo a chamada `setPersistence(this.auth, browserSessionPersistence)` descrita na issue com AngularFire 7.2.0 e, em seguida, compare-a com a importação de `setPersistence` de `@firebase/auth`. Está concluído quando a persistência funciona por meio de `@angular/fire/auth` sem o erro de construtor `BrowserSessionPersistence`.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, firebase, typescript
- Domínio
- authentication
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100