Skip to content

Commit

Permalink
fix: lower rate limit window for password reset
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Jan 31, 2024
1 parent c4a8a0b commit c9361cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frappe/core/doctype/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def sign_up(email: str, full_name: str, redirect_to: str) -> tuple[int, str]:


@frappe.whitelist(allow_guest=True)
@rate_limit(limit=get_password_reset_limit, seconds=24 * 60 * 60)
@rate_limit(limit=get_password_reset_limit, seconds=60 * 60)
def reset_password(user: str) -> str:
if user == "Administrator":
return "not allowed"
Expand Down
2 changes: 1 addition & 1 deletion frappe/utils/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,4 @@ def get_encryption_key():


def get_password_reset_limit():
return frappe.db.get_single_value("System Settings", "password_reset_limit") or 0
return frappe.get_system_settings("password_reset_limit") or 3

0 comments on commit c9361cc

Please sign in to comment.