refactor
This commit is contained in:
parent
6a9b7568af
commit
c81142e4a5
|
|
@ -25,12 +25,4 @@ class AccessTokenService
|
|||
}
|
||||
}
|
||||
|
||||
public function getUserFromToken(string $token)
|
||||
{
|
||||
$data = json_decode(base64_decode(strtr($token, '-_', '+/')), true);
|
||||
if (isset($data['user_identifier'])) {
|
||||
return $data['user_identifier'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
use League\Bundle\OAuth2ServerBundle\Model\Client;
|
||||
|
||||
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
class ClientService{
|
||||
/**
|
||||
* Retrieves a Client entity by its identifier.
|
||||
*
|
||||
* @param string $identifier The identifier of the client.
|
||||
* @param EntityManagerInterface $entityManager The entity manager to use for database operations.
|
||||
* @return Client|null The Client entity or null if not found.
|
||||
*/
|
||||
|
||||
public function getClientIdentifier(String $identifier, EntityManagerInterface $entityManager): Client
|
||||
{
|
||||
return $entityManager->getRepository(Client::class)->findOneBy(['identifier' => $identifier]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue