Skip to content

Commit d089a3a

Browse files
committed
Allow using \ArrayAccess as $key in decode
1 parent f68efb8 commit d089a3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Authentication/JWT.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function decode($jwt, $key = null, $allowed_algs = array())
7373
if (!is_array($allowed_algs) || !in_array($header->alg, $allowed_algs)) {
7474
throw new DomainException('Algorithm not allowed');
7575
}
76-
if (is_array($key)) {
76+
if (is_array($key) || $key instanceof \ArrayAccess) {
7777
if (isset($header->kid)) {
7878
$key = $key[$header->kid];
7979
} else {

0 commit comments

Comments
 (0)