fix: enhance error handling in password reset process
This commit is contained in:
parent
a0f4526c58
commit
9f92e7bf0d
1 changed files with 6 additions and 1 deletions
|
|
@ -1167,7 +1167,12 @@ def reset_password(user: str) -> str:
|
|||
# For Administrator or disabled users: silently skip — same response below
|
||||
except frappe.DoesNotExistError:
|
||||
frappe.clear_messages()
|
||||
# Do not reveal whether the account exists — fall through to generic response
|
||||
except frappe.OutgoingEmailError:
|
||||
frappe.clear_messages()
|
||||
frappe.log_error(title="Password reset email could not be sent", message=frappe.get_traceback())
|
||||
except Exception:
|
||||
frappe.clear_messages()
|
||||
frappe.log_error(title="Password reset failed unexpectedly", message=frappe.get_traceback())
|
||||
|
||||
return frappe.msgprint(
|
||||
msg=_("If an account with this email exists, password reset instructions have been sent."),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue