question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Emulator: auth functions not triggered

See original GitHub issue

It 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) image

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:closed
  • Created 3 years ago
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
johanbuyscommented, Nov 27, 2020

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.

2reactions
johanbuyscommented, Dec 22, 2020

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 local onCreate functions will not get called.

see here: https://github.com/firebase/firebaseui-web/issues/778#issuecomment-721535405

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found