We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08c7ba6 commit 80a94c4Copy full SHA for 80a94c4
src/JWT.php
@@ -188,13 +188,14 @@ public static function encode(
188
string $keyId = null,
189
array $head = null
190
): string {
191
- $header = ['typ' => 'JWT', 'alg' => $alg];
+ $header = ['typ' => 'JWT'];
192
if ($keyId !== null) {
193
$header['kid'] = $keyId;
194
}
195
if (isset($head) && \is_array($head)) {
196
- $header = \array_merge($head, $header);
+ $header = \array_merge($header, $head);
197
198
+ $header['alg'] = $alg;
199
$segments = [];
200
$segments[] = static::urlsafeB64Encode((string) static::jsonEncode($header));
201
$segments[] = static::urlsafeB64Encode((string) static::jsonEncode($payload));
0 commit comments