fix: dont respond to login api call if email login is disabled (#20311)

This commit is contained in:
Ankush Menat 2023-03-13 11:06:15 +05:30 committed by GitHub
parent 97ca92e3d1
commit 90be13e7ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,6 +121,9 @@ def login_via_token(login_token: str):
@rate_limit(limit=5, seconds=60 * 60)
def send_login_link(email: str):
if not frappe.get_system_settings("login_with_email_link"):
return
expiry = frappe.get_system_settings("login_with_email_link_expiry") or 10
link = _generate_temporary_login_link(email, expiry)