Closed
Description
Version info
Angular:
10.2.0
Firebase:
8.0.1
AngularFire:
6.0.4
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
Simple context recreation in a repo since StackBlitz won't help with emulators.
https://github.com/jornetsimon/af-auth-debug
Steps to set up and reproduce
- Set up the Firebase Authentication emulator.
- Set up an authentication method (email/password for example) and implement it on a page
- Call this.afAuth.useEmulator('http://localhost:9099/') (or whatever the port is set to).
- Subscribe to authState from another page
- Sign up : the user is authenticated correctly
- Reload the app
- The call to authState returns a 400 INVALID_ID_TOKEN error, and the request URL points to Firebase servers (googleapis.com)
Debug output
Expected behavior
When using useEmulator(), the call to retrieve the authState should target the emulator (localhost:9099).
AngularFireAuth.user and AngularFireAuth.user should return the previously authenticated user.
Actual behavior
During the sign up process (createUserWithEmailAndPassword() / signInWithEmailLink), the calls point to the emulator.
But that is not the case with authState.
Metadata
Metadata
Assignees
Labels
No labels