diff --git a/frappe/auth.py b/frappe/auth.py index 7c2302d4a8..0f690b7684 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -702,7 +702,7 @@ def validate_auth_via_api_keys(authorization_header): def validate_api_key_secret(api_key, api_secret, frappe_authorization_source=None): """frappe_authorization_source to provide api key and secret for a doctype apart from User""" doctype = frappe_authorization_source or "User" - doc = frappe.db.get_value(doctype=doctype, filters={"api_key": api_key}, fieldname=["name"]) + doc = frappe.db.get_value(doctype=doctype, filters={"api_key": api_key, "enabled": True}, fieldname=["name"]) if not doc: raise frappe.AuthenticationError form_dict = frappe.local.form_dict