mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 22:47:50 +08:00
15 lines
371 B
PHP
15 lines
371 B
PHP
<?php
|
|
|
|
namespace App\Lib\Jwt;
|
|
|
|
use Lcobucci\JWT\Token;
|
|
use Lcobucci\JWT\Validation\Constraint;
|
|
use Lcobucci\JWT\Validation\ConstraintViolation;
|
|
|
|
class RefreshTokenConstraint implements Constraint
|
|
{
|
|
public function assert(Token $token): void
|
|
{
|
|
if ($token->isRelatedTo('refresh')) throw ConstraintViolation::error('Token is a refresh token', $this);
|
|
}
|
|
} |