I am setting up a firebase authentication system with firebase. As I wanted it to be username and password, I needed to do it myself.
The workflow is this:
- Cloud function gets username and password
- It get the corresponding email from firestore
- It use signInWithEmailAndPassword() to sign in and get the user data
- It it createCustomToken() with the user uid and data that I need
- It returns the token to the webclient
- Webclient use signInWithCustomToken() with the token
- The onAuthStateChanged callback gets trigger and setup my data from the user data
This process works great when deploy in firebase.
The problem is that when I want to use it with the firebase emulator, the user variable on step 7 has no data (no email, no displayName, etc are all set to null). I know that custom token are not signed when generated from the emulator, but is there a way to still get the data out of them?
Thanks