mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 11:20:53 +08:00
Revert "fix: resolve PHPStan static analysis warnings"
This reverts commit 2d3e4b4a95.
This commit is contained in:
@@ -40,13 +40,7 @@ class AuthService
|
||||
return $this->user->tokens()->get()->toArray();
|
||||
}
|
||||
|
||||
public function removeSession(string $sessionId): bool
|
||||
{
|
||||
$this->user->tokens()->where('id', $sessionId)->delete();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function removeAllSessions(): bool
|
||||
public function removeSession(): bool
|
||||
{
|
||||
$this->user->tokens()->delete();
|
||||
return true;
|
||||
@@ -60,26 +54,4 @@ class AuthService
|
||||
|
||||
return $accessToken?->tokenable;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密认证数据
|
||||
*
|
||||
* @param string $authorization
|
||||
* @return array|null 用户数据或null
|
||||
*/
|
||||
public static function decryptAuthData(string $authorization): ?array
|
||||
{
|
||||
$user = self::findUserByBearerToken($authorization);
|
||||
|
||||
if (!$user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $user->id,
|
||||
'email' => $user->email,
|
||||
'is_admin' => (bool)$user->is_admin,
|
||||
'is_staff' => (bool)$user->is_staff
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user