From 7666ea74f1efb9d10d95f773889c4f804223feff Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Fri, 17 Nov 2023 19:26:28 +0530 Subject: [PATCH] fix: validate_auth hooks for non Authorization headers --- frappe/auth.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frappe/auth.py b/frappe/auth.py index 648f72f8e7..e005331c50 100644 --- a/frappe/auth.py +++ b/frappe/auth.py @@ -573,12 +573,13 @@ def validate_auth(): if len(authorization_header) == 2: validate_oauth(authorization_header) validate_auth_via_api_keys(authorization_header) - validate_auth_via_hooks() - # If login via bearer, basic or keypair didn't work then authentication failed and we - # should terminate here. - if frappe.session.user in ("", "Guest"): - raise frappe.AuthenticationError + validate_auth_via_hooks() + + # If login via bearer, basic or keypair didn't work then authentication failed and we + # should terminate here. + if frappe.session.user in ("", "Guest"): + raise frappe.AuthenticationError def validate_oauth(authorization_header):