Skip to content

Commit 80a94c4

Browse files
committed
WIP
1 parent 08c7ba6 commit 80a94c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/JWT.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,14 @@ public static function encode(
188188
string $keyId = null,
189189
array $head = null
190190
): string {
191-
$header = ['typ' => 'JWT', 'alg' => $alg];
191+
$header = ['typ' => 'JWT'];
192192
if ($keyId !== null) {
193193
$header['kid'] = $keyId;
194194
}
195195
if (isset($head) && \is_array($head)) {
196-
$header = \array_merge($head, $header);
196+
$header = \array_merge($header, $head);
197197
}
198+
$header['alg'] = $alg;
198199
$segments = [];
199200
$segments[] = static::urlsafeB64Encode((string) static::jsonEncode($header));
200201
$segments[] = static::urlsafeB64Encode((string) static::jsonEncode($payload));

0 commit comments

Comments
 (0)