Skip to content

Commit ff788e4

Browse files
authored
Update JWTTools.php
1 parent 800729f commit ff788e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JWTTools.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use yii\db\ActiveRecord;
1515
use yii\helpers\BaseStringHelper;
1616
use yii\web\UnauthorizedHttpException;
17+
use Firebase\JWT\Key;
1718

1819
final class JWTTools
1920
{
@@ -137,7 +138,7 @@ public function getJWT(): string
137138
public function decodeToken(string $token): stdClass
138139
{
139140
try {
140-
return JWT::decode($token, $this->secretKey, [$this->algorithm]);
141+
return JWT::decode($token, new Key($this->secretKey, $this->algorithm));
141142
} catch (\Throwable $e) {
142143
throw new UnauthorizedHttpException($e->getMessage());
143144
}

0 commit comments

Comments
 (0)