mirror of
http://124.126.16.154:8888/singularity/hdk-auth.git
synced 2026-01-15 06:15:08 +08:00
style: lint
This commit is contained in:
@@ -25,16 +25,10 @@ class AppAuthentication implements AuthenticationInterface
|
||||
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @Inject()
|
||||
* @var RequestInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private RequestInterface $request;
|
||||
|
||||
/**
|
||||
* @Inject()
|
||||
* @var Redis
|
||||
*/
|
||||
#[Inject]
|
||||
private Redis $redis;
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -40,10 +40,7 @@ class JwtAuthentication implements AuthenticationInterface
|
||||
use JustDont;
|
||||
use CannotInvalid;
|
||||
|
||||
/**
|
||||
* @Inject()
|
||||
* @var \Hyperf\HttpServer\Contract\RequestInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private RequestInterface $request;
|
||||
|
||||
public function generate(User $user): string
|
||||
@@ -90,7 +87,7 @@ class JwtAuthentication implements AuthenticationInterface
|
||||
throw new Unauthorized($error_code, $exception);
|
||||
}
|
||||
if (empty($decoded)) {
|
||||
throw new ValidateException(CommonErrorCode::AUTH_JWT_ERROR, 'token', $decoded);
|
||||
throw new ValidateException(CommonErrorCode::AUTH_JWT_ERROR, 'token', currentValue: $decoded);
|
||||
}
|
||||
|
||||
// 判断签发机构
|
||||
@@ -169,7 +166,7 @@ class JwtAuthentication implements AuthenticationInterface
|
||||
/** @var \Singularity\HDK\Auth\Resource\JsonWebToken $currentUser */
|
||||
$currentUser = Context::get('jwt');
|
||||
if (empty($currentUser)) {
|
||||
throw new Unauthorized(RFC7616::DIGEST);
|
||||
throw new Unauthorized();
|
||||
}
|
||||
|
||||
if (isset($column)) {
|
||||
|
||||
@@ -24,10 +24,7 @@ use Singularity\HDK\Auth\Services\AuthenticationInterface;
|
||||
*/
|
||||
trait LoginRequired
|
||||
{
|
||||
/**
|
||||
* @Inject()
|
||||
* @var AuthenticationInterface
|
||||
*/
|
||||
#[Inject]
|
||||
private AuthenticationInterface $authentication;
|
||||
|
||||
public function authorize(): bool {
|
||||
|
||||
Reference in New Issue
Block a user