fix: call auth hooks before validate auth
This commit is contained in:
parent
fea87d09dc
commit
1ecb60f1b0
2 changed files with 3 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ import frappe.rate_limiter
|
|||
import frappe.recorder
|
||||
import frappe.utils.response
|
||||
from frappe import _
|
||||
from frappe.auth import SAFE_HTTP_METHODS, UNSAFE_HTTP_METHODS, HTTPRequest, validate_auth
|
||||
from frappe.auth import SAFE_HTTP_METHODS, UNSAFE_HTTP_METHODS, HTTPRequest, validate_auth, validate_auth_via_hooks
|
||||
from frappe.middlewares import StaticDataMiddleware
|
||||
from frappe.utils import CallbackManager, cint, get_site_name
|
||||
from frappe.utils.data import escape_html
|
||||
|
|
@ -94,6 +94,8 @@ def application(request: Request):
|
|||
|
||||
init_request(request)
|
||||
|
||||
validate_auth_via_hooks()
|
||||
|
||||
validate_auth()
|
||||
|
||||
if request.method == "OPTIONS":
|
||||
|
|
|
|||
|
|
@ -571,7 +571,6 @@ 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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue