get_user_by_email
can silently return wrong result when "allow multiple accounts with the same email address" is set
#843
Labels
Describe your environment
6.6.0
auth
3.12
uv 0.5.11
Describe the problem
I'm worried that the
get_user_by_email
function misleadingly silently skips some results.It's typed as returning a single user record given an email address:
firebase-admin-python/firebase_admin/_auth_client.py
Lines 179 to 194 in 8ba819a
However, it is possible to configure Firebase to allow multiple accounts with the same email address: https://support.google.com/firebase/answer/9134820
It looks like the implementation takes just the first user record if more than one matches the provided email:
firebase-admin-python/firebase_admin/_user_mgt.py
Lines 583 to 602 in 8ba819a
I'd suggest replacing it with a
get_users_by_email
that returns a collections of records, to avoid misleading programmers unfamiliar with the "allow multiple accounts with the same email address" option.The text was updated successfully, but these errors were encountered: