Skip to content

Commit

Permalink
Merge pull request #98 from geekwright/jwtupdates
Browse files Browse the repository at this point in the history
Update to firebase/php-jwt 6.0.0
  • Loading branch information
geekwright authored Mar 19, 2023
2 parents 42a5d0e + a0da343 commit c52381b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"kint-php/kint": "^3.3",
"symfony/yaml": "^2.8",
"paragonie/random_compat": "^2",
"firebase/php-jwt": "^5.0",
"firebase/php-jwt": "6.0.0",
"webmozart/assert": "1.9.1"
},
"require-dev": {
Expand Down
6 changes: 3 additions & 3 deletions src/Jwt/JsonWebToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Xmf\Jwt;

use Firebase\JWT\JWT;
use Firebase\JWT\Key;
use Xmf\Key\KeyAbstract;

/**
Expand All @@ -20,7 +21,7 @@
* @category Xmf\Jwt\JsonWebToken
* @package Xmf
* @author Richard Griffith <[email protected]>
* @copyright 2018 XOOPS Project (https://xoops.org)
* @copyright 2018-2023 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link https://xoops.org
*/
Expand Down Expand Up @@ -80,9 +81,8 @@ public function setAlgorithm($algorithm)
*/
public function decode($jwtString, $assertClaims = array())
{
$allowedAlgorithms = array($this->algorithm);
try {
$values = JWT::decode($jwtString, $this->key->getVerifying(), $allowedAlgorithms);
$values = JWT::decode($jwtString, new Key($this->key->getVerifying(), $this->algorithm));
} catch (\Exception $e) {
trigger_error($e->getMessage(), E_USER_NOTICE);
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/Key/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
use Xmf\Random;

/**
* Xmf\Key\StorageInterface
* Xmf\Key\Basic
*
* load a database table
* a basic general purpose key
*
* @category Xmf\Key\Basic
* @package Xmf
* @author Richard Griffith <[email protected]>
* @copyright 2018 XOOPS Project (https://xoops.org)
* @copyright 2018-2023 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link https://xoops.org
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Key/KeyAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace Xmf\Key;

/**
* Xmf\Key\StorageInterface
* Xmf\Key\KeyAbstract
*
* load a database table
* manage key and related storage
*
* @category Xmf\Key\KeyAbstract
* @package Xmf
Expand Down

0 comments on commit c52381b

Please sign in to comment.