You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
admin.auth().getUserByEmail is case-insensitive against live data, but case-sensitive against emulator data #8344
Create a user in the emulator AND live environment with the same email: [email protected]
fetchUserByEmail.js
constadmin=require('firebase-admin');admin.initializeApp();(async()=>{try{constmatchingCase='[email protected]';constuser=awaitadmin.auth().getUserByEmail(matchingCase);console.log(user);// Logs}catch(e){console.error(e);// Doesn't Log}try{constnonMatchingCase='[email protected]';constuser=awaitadmin.auth().getUserByEmail(nonMatchingCase);// Throws auth/user-not-foundconsole.log(user);// Doesn't Log}catch(e){console.error(e);// Logs user not found error}awaitadmin.app().delete();})();
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.
Thanks for the report @djak250! It does look like this is a bug in the Auth emulator since it does not match the behavior in production. I'll mark this as reproducible and discuss it with our engineering team.
Activity
aalej commentedon Mar 21, 2025
Thanks for the report @djak250! It does look like this is a bug in the Auth emulator since it does not match the behavior in production. I'll mark this as reproducible and discuss it with our engineering team.