'How do I use the local Firebase Auth emulator and not production auth to test my users?

My app still expects to validate users with the production firebase-auth instance, despite having initialised the auth emulator locally with:

firebase init emulators

This is the auth logic in my React app:

const handleLogin = () => 
  authentication.signInWithEmailAndPassword("[email protected]", "emulator");

After handleLogin is triggered, I get the error "auth/user-not-found" as firebase is querying the production auth instance instead.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source