Skip to content

Commit c52381b

Browse files
authored
Merge pull request #98 from geekwright/jwtupdates
Update to firebase/php-jwt 6.0.0
2 parents 42a5d0e + a0da343 commit c52381b

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"kint-php/kint": "^3.3",
1414
"symfony/yaml": "^2.8",
1515
"paragonie/random_compat": "^2",
16-
"firebase/php-jwt": "^5.0",
16+
"firebase/php-jwt": "6.0.0",
1717
"webmozart/assert": "1.9.1"
1818
},
1919
"require-dev": {

src/Jwt/JsonWebToken.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Xmf\Jwt;
1313

1414
use Firebase\JWT\JWT;
15+
use Firebase\JWT\Key;
1516
use Xmf\Key\KeyAbstract;
1617

1718
/**
@@ -20,7 +21,7 @@
2021
* @category Xmf\Jwt\JsonWebToken
2122
* @package Xmf
2223
* @author Richard Griffith <richard@geekwright.com>
23-
* @copyright 2018 XOOPS Project (https://xoops.org)
24+
* @copyright 2018-2023 XOOPS Project (https://xoops.org)
2425
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
2526
* @link https://xoops.org
2627
*/
@@ -80,9 +81,8 @@ public function setAlgorithm($algorithm)
8081
*/
8182
public function decode($jwtString, $assertClaims = array())
8283
{
83-
$allowedAlgorithms = array($this->algorithm);
8484
try {
85-
$values = JWT::decode($jwtString, $this->key->getVerifying(), $allowedAlgorithms);
85+
$values = JWT::decode($jwtString, new Key($this->key->getVerifying(), $this->algorithm));
8686
} catch (\Exception $e) {
8787
trigger_error($e->getMessage(), E_USER_NOTICE);
8888
return false;

src/Key/Basic.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
use Xmf\Random;
1515

1616
/**
17-
* Xmf\Key\StorageInterface
17+
* Xmf\Key\Basic
1818
*
19-
* load a database table
19+
* a basic general purpose key
2020
*
2121
* @category Xmf\Key\Basic
2222
* @package Xmf
2323
* @author Richard Griffith <richard@geekwright.com>
24-
* @copyright 2018 XOOPS Project (https://xoops.org)
24+
* @copyright 2018-2023 XOOPS Project (https://xoops.org)
2525
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
2626
* @link https://xoops.org
2727
*/

src/Key/KeyAbstract.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
namespace Xmf\Key;
1313

1414
/**
15-
* Xmf\Key\StorageInterface
15+
* Xmf\Key\KeyAbstract
1616
*
17-
* load a database table
17+
* manage key and related storage
1818
*
1919
* @category Xmf\Key\KeyAbstract
2020
* @package Xmf

0 commit comments

Comments
 (0)