Emulator: auth functions not triggered
See original GitHub issueIt seems that the firebase functions based on auth events (in my case functions.auth.user().onCreate) are not triggered within the emulator suite.
In Emulator UI i’m able to see that my auth function is initialized correctly but nothing happens when a user is created (from client side with auth.createUserWithEmailAndPassword()
method)
I set the required env variables (FIREBASE_AUTH_EMULATOR_HOST and GCLOUD_PROJEC) when launching the emulator
My dependencies are up to date : firebase-tools 8.16.2 firebase-admin: 9.4.1 firebase-functions: 3.11.0
Note : regular firebase functions are triggered properly in the emulator.
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (10 by maintainers)
Top Results From Across the Web
Connect your app to the Authentication Emulator - Firebase
When working with real Firebase projects, you can run emulators for any or all of ... However, for phone authentication flows, the emulator...
Read more >Firebase Cloud Function Auth Trigger not firing - Stack Overflow
I'm using Express in my Cloud Function with multiple routes, and I'm trying to add in a function that when triggered, will pull...
Read more >Firebase Authentication triggers not working!! - Google Groups
I am using Firebase for Authentication and use Cloud Function "functions.auth(). ... onDelete () trigger does not work when deleting a user use...
Read more >Firebase Authentication Triggers - Cloud Functions
Firebase accounts trigger user creation events for Cloud Functions when: ... Note: A Cloud Functions event is not triggered when a user signs...
Read more >The Full Guide on how to use the Firebase Emulator for the Web
Working locally, you can not only work faster (everything is in your machine), but also spend less money? ... To get the functions...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am having the same issue.
Other Functions are working “https.onCall” Debugger jumps to breakpoints etc, but auth.user().onCreate is not firing, don’t know if the emulator suite emulates this behaviour but auth.user().onCreate also does not fire when creating a user from the emulator dashboard.
Hi, An update from my side, after updating firebase-tools the
onCreate
function is firing again.Also one thing to note is that firebase-ui is not compatible with the auth emulator the firebase-ui team is still working on getting it to work. When using Firebase-ui it will send all comms to the configured project directly.
NB: So when you use firebase-ui all auth requests will bypass the emulator (even if
useEmulator()
is called) and thus the localonCreate
functions will not get called.see here: https://github.com/firebase/firebaseui-web/issues/778#issuecomment-721535405