mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-23 22:34:50 +03:00
throw on save error
This commit is contained in:
parent
665f4ac2d4
commit
0caade0e28
@ -74,7 +74,10 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
|
|||||||
$data['client_id'] = $client->id;
|
$data['client_id'] = $client->id;
|
||||||
unset($data['client_identifier']);
|
unset($data['client_identifier']);
|
||||||
|
|
||||||
$this->accessTokenModel->save($data);
|
if (!$this->accessTokenModel->save($data))
|
||||||
|
{
|
||||||
|
throw new \RuntimeException($this->accessTokenModel->getError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function revokeAccessToken($tokenId): void
|
public function revokeAccessToken($tokenId): void
|
||||||
@ -86,7 +89,7 @@ class AccessTokenRepository implements AccessTokenRepositoryInterface
|
|||||||
* @param string $tokenId
|
* @param string $tokenId
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @since version
|
* @since version
|
||||||
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
||||||
*/
|
*/
|
||||||
public function isAccessTokenRevoked($tokenId): bool
|
public function isAccessTokenRevoked($tokenId): bool
|
||||||
|
@ -70,7 +70,10 @@ class AuthCodeRepository implements AuthCodeRepositoryInterface
|
|||||||
$data['client_id'] = $client->id;
|
$data['client_id'] = $client->id;
|
||||||
unset($data['client_identifier']);
|
unset($data['client_identifier']);
|
||||||
|
|
||||||
$this->authCodeModel->save($data);
|
if (!$this->authCodeModel->save($data))
|
||||||
|
{
|
||||||
|
throw new \RuntimeException($this->authCodeModel->getError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function revokeAuthCode($codeId): void
|
public function revokeAuthCode($codeId): void
|
||||||
@ -82,7 +85,7 @@ class AuthCodeRepository implements AuthCodeRepositoryInterface
|
|||||||
* @param string $codeId
|
* @param string $codeId
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @since version
|
* @since version
|
||||||
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
||||||
*/
|
*/
|
||||||
public function isAuthCodeRevoked($codeId): bool
|
public function isAuthCodeRevoked($codeId): bool
|
||||||
|
@ -72,7 +72,10 @@ class RefreshTokenRepository implements RefreshTokenRepositoryInterface
|
|||||||
unset($data['access_token_identifier']);
|
unset($data['access_token_identifier']);
|
||||||
$data['access_token_id'] = $accessToken->id;
|
$data['access_token_id'] = $accessToken->id;
|
||||||
|
|
||||||
$this->refreshTokenModel->save($data);
|
if (!$this->refreshTokenModel->save($data))
|
||||||
|
{
|
||||||
|
throw new \RuntimeException($this->refreshTokenModel->getError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function revokeRefreshToken($tokenId): void
|
public function revokeRefreshToken($tokenId): void
|
||||||
@ -84,7 +87,7 @@ class RefreshTokenRepository implements RefreshTokenRepositoryInterface
|
|||||||
* @param string $tokenId
|
* @param string $tokenId
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @since version
|
* @since version
|
||||||
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
||||||
*/
|
*/
|
||||||
public function isRefreshTokenRevoked($tokenId): bool
|
public function isRefreshTokenRevoked($tokenId): bool
|
||||||
|
Loading…
Reference in New Issue
Block a user