Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,6 @@
'count' => 1,
'path' => __DIR__ . '/tests/Authentication/Authenticators/SessionAuthenticatorTest.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Parameter #1 $headers of method Tests\\Authentication\\Filters\\AbstractFilterTestCase::withHeaders() expects array<string, CodeIgniter\\HTTP\\Header|list<CodeIgniter\\HTTP\\Header>>, array{Authorization: non-falsy-string} given.',
'identifier' => 'argument.type',
'count' => 7,
'path' => __DIR__ . '/tests/Authentication/Filters/HmacFilterTest.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Parameter #1 $headers of method Tests\\Authentication\\Filters\\JWTFilterTest::withHeaders() expects array<string, CodeIgniter\\HTTP\\Header|list<CodeIgniter\\HTTP\\Header>>, array{Authorization: non-falsy-string} given.',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/tests/Authentication/Filters/JWTFilterTest.php',
];
$ignoreErrors[] = [
'rawMessage' => 'Implicit array creation is not allowed - variable $users might not exist.',
'identifier' => 'variable.implicitArray',
Expand Down
4 changes: 1 addition & 3 deletions src/Authentication/Authenticators/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ public function getTokenFromRequest(RequestInterface $request): string
/** @var AuthJWT $config */
$config = config('AuthJWT');

$tokenHeader = $request->getHeaderLine(
$config->authenticatorHeader ?? 'Authorization',
);
$tokenHeader = $request->getHeaderLine($config->authenticatorHeader);

if (str_starts_with($tokenHeader, 'Bearer')) {
return trim(substr($tokenHeader, 6));
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/Authenticators/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private function recordLoginAttempt(
// Determine the type of ID we're using.
// Standard fields would be email, username,
// but any column within config('Auth')->validFields can be used.
$field = array_intersect(config('Auth')->validFields ?? [], array_keys($credentials));
$field = array_intersect(config('Auth')->validFields, array_keys($credentials));

if (count($field) !== 1) {
throw new InvalidArgumentException('Invalid credentials passed to recordLoginAttempt.');
Expand Down
Loading