Skip to content

Commit 61da830

Browse files
committed
Update firebase/php-jwt to 6.1
1 parent 1493c01 commit 61da830

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"php": "^7.2|^8.0",
3232
"ext-xml": "*",
3333
"johnstevenson/json-works": "~1.1",
34-
"firebase/php-jwt": "^5.0",
34+
"firebase/php-jwt": "^6.1",
3535
"guzzlehttp/guzzle": "~6.0|~7.0",
3636
"ext-json": "*"
3737
},

src/OpenTok/Util/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private function createAuthHeader()
108108
'exp' => time() + (5 * 60),
109109
'jti' => uniqid(),
110110
);
111-
return JWT::encode($token, $this->apiSecret);
111+
return JWT::encode($token, $this->apiSecret, 'HS256');
112112
}
113113

114114
// General API Requests

tests/OpenTokTest/TestHelpers.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
namespace OpenTokTest;
44

55
use GuzzleHttp\Psr7\Response;
6-
use \Firebase\JWT\JWT;
6+
use Firebase\JWT\Key;
7+
use Firebase\JWT\JWT;
78

89
class TestHelpers
910
{
@@ -40,7 +41,7 @@ public static function validateOpenTokAuthHeader($apiKey, $apiSecret, $token)
4041
}
4142

4243
try {
43-
$decodedToken = JWT::decode($token, $apiSecret, array('HS256'));
44+
$decodedToken = JWT::decode($token, new Key($apiSecret, 'HS256'));
4445
} catch (\Exception $e) {
4546
return false;
4647
}

0 commit comments

Comments
 (0)