mirror of
https://github.com/elyby/accounts.git
synced 2024-11-10 07:22:00 +05:30
Handle legacy refresh tokens
This commit is contained in:
parent
a9a56c9e1d
commit
060a4e960a
@ -46,6 +46,11 @@ class RefreshTokenGrant extends BaseRefreshTokenGrant {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $refreshToken
|
||||
* @return array
|
||||
* @throws OAuthServerException
|
||||
*/
|
||||
private function validateLegacyRefreshToken(string $refreshToken): array {
|
||||
$result = Yii::$app->redis->get("oauth:refresh:tokens:{$refreshToken}");
|
||||
if ($result === null) {
|
||||
|
@ -30,8 +30,7 @@ class RefreshTokenRepository implements RefreshTokenRepositoryInterface {
|
||||
}
|
||||
|
||||
public function isRefreshTokenRevoked($tokenId): bool {
|
||||
// TODO: validate old refresh tokens
|
||||
return !OauthRefreshToken::find()->andWhere(['id' => $tokenId])->exists();
|
||||
return OauthRefreshToken::find()->andWhere(['id' => $tokenId])->exists() === false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user