fix: call auth hooks before raising error
This commit is contained in:
parent
443d508669
commit
fea87d09dc
1 changed files with 2 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue