diff --git a/frappe/auth.py b/frappe/auth.py index 4b53e76533..65e1fe8fac 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -571,6 +571,7 @@ def validate_auth(): authorization_header = frappe.get_request_header("Authorization", "").split(" ") if len(authorization_header) == 2: + validate_auth_via_hooks() validate_oauth(authorization_header) validate_auth_via_api_keys(authorization_header) @@ -579,8 +580,6 @@ def validate_auth(): if frappe.session.user in ("", "Guest"): raise frappe.AuthenticationError - validate_auth_via_hooks() - def validate_oauth(authorization_header): """ @@ -621,7 +620,7 @@ def validate_oauth(authorization_header): frappe.set_user(frappe.db.get_value("OAuth Bearer Token", token, "user")) frappe.local.form_dict = form_dict except AttributeError: - raise frappe.AuthenticationError + pass def validate_auth_via_api_keys(authorization_header):