fix: duplicate validate_auth calls
This commit is contained in:
parent
497b07f049
commit
8c74df6cc3
2 changed files with 5 additions and 5 deletions
|
|
@ -181,13 +181,13 @@ def validate_oauth(authorization_header):
|
|||
|
||||
try:
|
||||
required_scopes = frappe.db.get_value("OAuth Bearer Token", token, "scopes").split(get_url_delimiter())
|
||||
valid, oauthlib_request = get_oauth_server().verify_request(uri, http_method, body, headers, required_scopes)
|
||||
if valid:
|
||||
frappe.set_user(frappe.db.get_value("OAuth Bearer Token", token, "user"))
|
||||
frappe.local.form_dict = form_dict
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
valid, oauthlib_request = get_oauth_server().verify_request(uri, http_method, body, headers, required_scopes)
|
||||
if valid:
|
||||
frappe.set_user(frappe.db.get_value("OAuth Bearer Token", token, "user"))
|
||||
frappe.local.form_dict = form_dict
|
||||
|
||||
|
||||
def validate_auth_via_api_keys(authorization_header):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ ALLOWED_MIMETYPES = ('image/png', 'image/jpeg', 'application/pdf', 'application/
|
|||
|
||||
def handle():
|
||||
"""handle request"""
|
||||
validate_auth()
|
||||
|
||||
cmd = frappe.local.form_dict.cmd
|
||||
data = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue