mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 17:07:49 +08:00
fix : jwt
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Middleware\Token;
|
||||
|
||||
use App\Constants\ResultCode;
|
||||
use App\Exception\ErrException;
|
||||
use App\Interface\JwtInterface;
|
||||
use Lcobucci\JWT\Token\RegisteredClaims;
|
||||
@@ -24,6 +25,7 @@ final class AdminTokenMiddleware extends AbstractTokenMiddleware
|
||||
public function checkIssuer(UnencryptedToken $token): void
|
||||
{
|
||||
$audience = $token->claims()->get(RegisteredClaims::ISSUER);
|
||||
if ($audience === env('APP_NAME') .'_admin') throw new ErrException('token错误');
|
||||
|
||||
if ($audience !== env('APP_NAME') .'_admin') throw new ErrException('token错误',ResultCode::JWT_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user