|
|
@@ -12,7 +12,8 @@ class AuthService
|
|
|
{
|
|
|
public function __construct(
|
|
|
protected AuthRepositoryInterface $authRepository,
|
|
|
- ) {}
|
|
|
+ ) {
|
|
|
+ }
|
|
|
|
|
|
public function login(AuthDTO $credentials): ?array
|
|
|
{
|
|
|
@@ -36,7 +37,7 @@ public function login(AuthDTO $credentials): ?array
|
|
|
|
|
|
public function refresh(RefreshTokenDTO $refreshToken): ?array
|
|
|
{
|
|
|
- $tokenModel = $this->authRepository->findToken(token: $refreshToken->token);
|
|
|
+ $tokenModel = $this->authRepository->findToken( $refreshToken->token);
|
|
|
|
|
|
if (!$tokenModel || !in_array(needle: 'refresh', haystack: $tokenModel->abilities) || $tokenModel->expires_at < now()) {
|
|
|
return null;
|
|
|
@@ -49,7 +50,7 @@ public function refresh(RefreshTokenDTO $refreshToken): ?array
|
|
|
|
|
|
$deviceId = Str::afterLast(subject: $tokenModel->name, search: '_');
|
|
|
|
|
|
- $tokens = $this->authRepository->refreshToken(token: $tokenModel, user: $user, deviceId: $deviceId);
|
|
|
+ $tokens = $this->authRepository->refreshToken($tokenModel, $user, $deviceId);
|
|
|
|
|
|
return array_merge($tokens, [
|
|
|
'user' => $user,
|