-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
[REQUIRED] Environment info
firebase-tools: 13.34.0
Platform: macOs
[REQUIRED] Test case
Environment setup
- Start up just the auth emulator and export emulator host
firebase emulators:start --only auth --project demo-project- Create a user in the emulator AND live environment with the same email:
email@example.com
fetchUserByEmail.js
const admin = require('firebase-admin');
admin.initializeApp();
(async () => {
try {
const matchingCase = 'email@example.com';
const user = await admin.auth().getUserByEmail(matchingCase);
console.log(user); // Logs
} catch (e) {
console.error(e); // Doesn't Log
}
try {
const nonMatchingCase = 'EmAiL@eXaMpLe.com';
const user = await admin.auth().getUserByEmail(nonMatchingCase); // Throws auth/user-not-found
console.log(user); // Doesn't Log
} catch (e) {
console.error(e); // Logs user not found error
}
await admin.app().delete();
})();[REQUIRED] Steps to reproduce
- Run script against emulator:
FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 \
GCLOUD_PROJECT_ID=demo-project \
node ./fetchUserByEmail.js- Run script against live data:
GCLOUD_PROJECT_ID=project-live \
node ./fetchUserByEmail.js[REQUIRED] Expected behavior
The user is found in both environments, regardless of email casing.
[REQUIRED] Actual behavior
The user is found in the live environment, regardless of email casing.
The user is found in the emulator environment when the casing matches,
but throws an auth/user-not-found error when casing does not match.
djohnson-aperture