UserNotFoundError is not raised as expected. Instead, UnexpectedResponseError is raised.
@jonathanedey がすでに取り組んでいます。
2025年1月10日 から。
評価
この issue はまだ評価されていません。
説明
[READ] Step 1: Are you in the right place?
- For issues related to the code in this repository file a GitHub issue.
- If the issue pertains to Cloud Firestore, report directly in the
Python Firestore GitHub repo. Firestore
bugs reported in this repo will be closed with a reference to the Python Firestore
project. - For general technical questions, post a question on StackOverflow
with thefirebasetag. - For general Firebase discussion, use the firebase-talk
google group. - For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Operating System version: 14.2.1(23C71)
- Firebase SDK version: 6.3.0
- Firebase Product: auth
- Python version:3.12.0
- Pip version: 24.0
[REQUIRED] Step 3: Describe the problem
When calling the generate_password_reset_link, we got errors Failed to generate email action link. which is raised in _auth_utils.UnexpectedResponseError.
We expect UserNotFoundError to be raised if the email in request is not in authentication list.
Steps to reproduce:
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
Calling generate_password_reset_link with invalid email
Relevant Code:
def reset_password(
self, request: PostResetPasswordRequest, lang: str, client: MailjetClient
):
try:
password_link = auth.generate_password_reset_link(request.email)
except auth.UserNotFoundError:
# For security reasons, we don't want to reveal whether the email exists or not
logging.info(
f"Password reset request for non-existing email: {request.email}"
)
return None
except Exception as e:
logging.error(f"Failed to accept password reset request: {e}")
return None
def generate_email_action_link(self, action_type, email, action_code_settings=None):
"""Fetches the email action links for types
Args:
action_type: String. Valid values ['VERIFY_EMAIL', 'EMAIL_SIGNIN', 'PASSWORD_RESET']
email: Email of the user for which the action is performed
action_code_settings: ``ActionCodeSettings`` object or dict (optional). Defines whether
the link is to be handled by a mobile app and the additional state information to be
passed in the deep link, etc.
Returns:
link_url: action url to be emailed to the user
Raises:
UnexpectedResponseError: If the backend server responds with an unexpected message
FirebaseError: If an error occurs while generating the link
ValueError: If the provided arguments are invalid
"""
payload = {
'requestType': _auth_utils.validate_action_type(action_type),
'email': _auth_utils.validate_email(email),
'returnOobLink': True
}
if action_code_settings:
payload.update(encode_action_code_settings(action_code_settings))
body, http_resp = self._make_request('post', '/accounts:sendOobCode', json=payload)
if not body or not body.get('oobLink'):
raise _auth_utils.UnexpectedResponseError(
'Failed to generate email action link.', http_response=http_resp)
return body.get('oobLink')
- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 359
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-admin-python のほかの issue
-
api: remoteconfig
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
firebase/firebase-admin-python#957 · コメント 1 件 ·
-
api: database type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
firebase/firebase-admin-python#978 · コメント 1 件 ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) オープンapi: auth
firebase/firebase-admin-python#949 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
firebase/firebase-admin-python#945 · コメント 1 件 · リアクション 1 件 ·
firebase/firebase-admin-python の issue をすべて見る
似ている issue
-
essnmx good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
[Feature] 奇物选择添加优先级 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
syfoud/Simulated_Scepter#174 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Giskard-AI/giskard-oss#2840 · コメント 1 件 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success オープンarea: repo bug perceived difficulty: 2
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
yeti-platform/yeti#1380 ·