From b70b0bdf2fab868008834e330153da90858fd678 Mon Sep 17 00:00:00 2001 From: Alex Pushnov Date: Thu, 15 Aug 2024 00:02:13 -0700 Subject: [PATCH] Bugfix for the AuthToken and Hmac header line config. Mentioned in discussion https://github.com/codeigniter4/shield/discussions/1167 --- src/Filters/HmacAuth.php | 2 +- src/Filters/TokenAuth.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Filters/HmacAuth.php b/src/Filters/HmacAuth.php index 14e38ad0c..fd2123c04 100644 --- a/src/Filters/HmacAuth.php +++ b/src/Filters/HmacAuth.php @@ -33,7 +33,7 @@ public function before(RequestInterface $request, $arguments = null) $authenticator = auth('hmac')->getAuthenticator(); $requestParams = [ - 'token' => $request->getHeaderLine(setting('Auth.authenticatorHeader')['hmac'] ?? 'Authorization'), + 'token' => $request->getHeaderLine(setting('AuthToken.authenticatorHeader')['hmac'] ?? 'Authorization'), 'body' => $request->getBody() ?? '', ]; diff --git a/src/Filters/TokenAuth.php b/src/Filters/TokenAuth.php index b882e20d8..3cb8932ce 100644 --- a/src/Filters/TokenAuth.php +++ b/src/Filters/TokenAuth.php @@ -52,7 +52,7 @@ public function before(RequestInterface $request, $arguments = null) $authenticator = auth('tokens')->getAuthenticator(); $result = $authenticator->attempt([ - 'token' => $request->getHeaderLine(setting('Auth.authenticatorHeader')['tokens'] ?? 'Authorization'), + 'token' => $request->getHeaderLine(setting('AuthToken.authenticatorHeader')['tokens'] ?? 'Authorization'), ]); if (! $result->isOK() || (! empty($arguments) && $result->extraInfo()->tokenCant($arguments[0]))) {