Skip to content

Commit a588df7

Browse files
committed
Updated firebase/php-jwt to v6
1 parent 724b81e commit a588df7

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"ext-json": "*",
1515
"ext-zip": "*",
1616
"erusev/parsedown": "~1.0",
17-
"firebase/php-jwt": "~4.0|~5.0",
17+
"firebase/php-jwt": "^6.0",
1818
"intervention/image": "^2.3",
1919
"laravel/cashier": "^15.0"
2020
},

composer.lock

Lines changed: 17 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/JWT.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
use Illuminate\Support\Str;
66
use Firebase\JWT\JWT as FirebaseJWT;
7+
use Firebase\JWT\Key;
78

89
class JWT
910
{
11+
private const string ALG = 'HS256';
12+
1013
/**
1114
* Encode the given array as a JWT token.
1215
*
@@ -15,7 +18,7 @@ class JWT
1518
*/
1619
public static function encode($token)
1720
{
18-
return FirebaseJWT::encode($token, static::getKey());
21+
return FirebaseJWT::encode($token, static::getKey(), self::ALG);
1922
}
2023

2124
/**
@@ -26,7 +29,7 @@ public static function encode($token)
2629
*/
2730
public static function decode($token)
2831
{
29-
return (array) FirebaseJWT::decode($token, static::getKey(), ['HS256']);
32+
return (array) FirebaseJWT::decode($token, new Key(static::getKey(), self::ALG));
3033
}
3134

3235
/**

0 commit comments

Comments
 (0)