Skip to content

Commit f3885e8

Browse files
authored
Merge branch 'master' into master
2 parents e2f130d + 909bb58 commit f3885e8

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

composer.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@
88
"homepage": "https://github.com/macsidigital/laravel-api-client",
99
"license": "MIT",
1010
"type": "library",
11-
"authors": [
12-
{
13-
"name": "Colin Hall",
14-
"email": "[email protected]"
15-
}
16-
],
11+
"authors": [{
12+
"name": "Colin Hall",
13+
"email": "[email protected]"
14+
}],
1715
"require": {
1816
"php": "^7.3|^8.0|^8.1",
1917
"nesbot/carbon": "^1.26.3 || ^2.0",
2018
"guzzlehttp/guzzle": "~7.0|~6.0|~5.0|~4.0",
2119
"guzzlehttp/oauth-subscriber": "^0.6.0",
22-
"firebase/php-jwt": "^5.0",
20+
"firebase/php-jwt": "^6.0",
2321
"illuminate/support": "^7.0|^8.0|^9.0|^10.0",
2422
"macsidigital/laravel-oauth2-client": "^1.2|^2.0"
2523
},

src/Support/Authentication/JWT.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace MacsiDigital\API\Support\Authentication;
44

5+
use Firebase\JWT\Key;
56
use Firebase\JWT\JWT as FirebaseJWT;
67

78
class JWT
89
{
910
public static function generateToken($token, $secret)
1011
{
11-
return FirebaseJWT::encode($token, $secret);
12+
return FirebaseJWT::encode($token, $secret, 'HS256');
1213
}
1314

1415
public static function decodeToken($jwt, $secret)
1516
{
16-
return FirebaseJWT::decode($jwt, $secret, ['HS256']);
17+
return FirebaseJWT::decode($jwt, new Key($secret, 'HS256'));
1718
}
1819
}

0 commit comments

Comments
 (0)