mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-24 02:44:51 +03:00
Переделал проверку на try/catch
This commit is contained in:
parent
78486a87a8
commit
6089848c68
@ -42,10 +42,17 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
|
|||||||
|
|
||||||
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void
|
public function persistNewAccessToken(AccessTokenEntityInterface $accessTokenEntity): void
|
||||||
{
|
{
|
||||||
/** @var AccessToken $accessTokenEntity */
|
$found = false;
|
||||||
$accessToken = $this->accessTokenModel->getItemByIdentifier($accessTokenEntity->getIdentifier());
|
try {
|
||||||
|
/** @var AccessToken $accessTokenEntity */
|
||||||
|
$accessToken = $this->accessTokenModel->getItemByIdentifier($accessTokenEntity->getIdentifier());
|
||||||
|
if ($accessToken->id > 0) {
|
||||||
|
$found = true;
|
||||||
|
}
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
}
|
||||||
|
|
||||||
if ($accessToken->id > 0) {
|
if ($found) {
|
||||||
throw UniqueTokenIdentifierConstraintViolationException::create();
|
throw UniqueTokenIdentifierConstraintViolationException::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user