Skip to content

Commit d4afc96

Browse files
committed
Keep the cached key check
1 parent cafe96d commit d4afc96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/JWT.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ private static function getKey(
467467
return $keyOrKeyArray;
468468
}
469469

470+
if ($keyOrKeyArray instanceof CachedKeySet) {
471+
// Skip "isset" check, as this will automatically refresh if not set
472+
return $keyOrKeyArray[$kid];
473+
}
474+
470475
if (!is_array($keyOrKeyArray) && !$keyOrKeyArray instanceof ArrayAccess) {
471476
throw new UnexpectedValueException('Expecting a Key or an associative array of keys');
472477
}

0 commit comments

Comments
 (0)