fix(auth): adds missing EMAIL_NOT_FOUND error code by bojeil-google · Pull Request #550 · firebase/firebase-admin-python
Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError when /accounts:sendOobCode is called for password reset on a user that does not exist.
Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError when /accounts:sendOobCode is called for password reset on a user that does not exist.
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.
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:
| def test_get_user_non_existing(self, user_mgt_app): |
|
|
||
| Raises: | ||
| ValueError: If the provided arguments are invalid | ||
| UserNotFoundError: If no user exists by the specified email address. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be EmailNotFoundError?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair enough 👍
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM!
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, one tiny nit.
|
|
||
| Raises: | ||
| ValueError: If the provided arguments are invalid | ||
| EmailNotFoundError: If no user exists by the specified email address. |
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters