Skip to content

Commit

Permalink
fix: rate limit for all HTTP methods (#21929)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2b96324)

# Conflicts:
#	frappe/core/doctype/user/user.py
  • Loading branch information
sagarvora authored and mergify[bot] committed Aug 5, 2023
1 parent 5b42259 commit 04cf5a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions frappe/core/doctype/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,13 @@ def sign_up(email, full_name, redirect_to):


@frappe.whitelist(allow_guest=True)
<<<<<<< HEAD
@rate_limit(limit=get_password_reset_limit, seconds=24 * 60 * 60, methods=["POST"])
def reset_password(user):
=======
@rate_limit(limit=get_password_reset_limit, seconds=24 * 60 * 60)
def reset_password(user: str) -> str:
>>>>>>> 2b96324c31 (fix: rate limit for all HTTP methods (#21929))
if user == "Administrator":
return "not allowed"

Expand Down
2 changes: 1 addition & 1 deletion frappe/website/doctype/web_form/web_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def get_web_form_module(doc):


@frappe.whitelist(allow_guest=True)
@rate_limit(key="web_form", limit=5, seconds=60, methods=["POST"])
@rate_limit(key="web_form", limit=5, seconds=60)
def accept(web_form, data):
"""Save the web form"""
data = frappe._dict(json.loads(data))
Expand Down

0 comments on commit 04cf5a6

Please sign in to comment.