-
Couldn't load subscription status.
- Fork 343
fix(auth): adds missing EMAIL_NOT_FOUND error code #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError when /accounts:sendOobCode is called for password reset on a user that does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @bojeil-google !
LGTM. Please add a TW to review the reference doc changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possible typo. Can we also add a test case? Similar to:
firebase-admin-python/tests/test_user_mgt.py
Line 286 in ebf0961
| def test_get_user_non_existing(self, user_mgt_app): |
firebase_admin/_auth_client.py
Outdated
| Raises: | ||
| ValueError: If the provided arguments are invalid | ||
| UserNotFoundError: If no user exists by the specified email address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be EmailNotFoundError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this is the problem. They throw different errors. For password reset, they throw EMAIL_NOT_FOUND. For email verification, they throw USER_NOT_FOUND.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair enough 👍
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, one tiny nit.
firebase_admin/_auth_client.py
Outdated
| Raises: | ||
| ValueError: If the provided arguments are invalid | ||
| EmailNotFoundError: If no user exists by the specified email address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to use "by" here?
I'd expect "for" probably, here and below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching. I copied and pasted blindly. It is fixed now here and elsewhere.
Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError when /accounts:sendOobCode is called for password reset on a user that does not exist.