From 5fc4400eee7cb2012961ade9bde63ac6d07412bd Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Fri, 17 Nov 2023 15:55:55 +0530 Subject: [PATCH] fix: revert raise error internal function get_decrypted_password raises error no point in removing error from call --- frappe/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/auth.py b/frappe/auth.py index 294154a167..27aff63371 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -646,7 +646,7 @@ def validate_auth_via_api_keys(authorization_header): frappe.InvalidAuthorizationToken, ) except (AttributeError, TypeError, ValueError): - pass + raise frappe.AuthenticationError def validate_api_key_secret(api_key, api_secret, frappe_authorization_source=None): @@ -654,7 +654,7 @@ def validate_api_key_secret(api_key, api_secret, frappe_authorization_source=Non doctype = frappe_authorization_source or "User" doc = frappe.db.get_value(doctype=doctype, filters={"api_key": api_key}, fieldname=["name"]) if not doc: - return + raise frappe.AuthenticationError form_dict = frappe.local.form_dict doc_secret = get_decrypted_password(doctype, doc, fieldname="api_secret") if api_secret == doc_secret: