mirror of
https://github.com/elyby/accounts.git
synced 2025-01-15 00:12:10 +05:30
Исправлена ошибка при попытке рефрешнуть несуществующий oauth refresh token
This commit is contained in:
parent
38d68721eb
commit
b069ec630d
@ -18,6 +18,9 @@ class RefreshTokenStorage extends AbstractStorage implements RefreshTokenInterfa
|
|||||||
|
|
||||||
public function get($token) {
|
public function get($token) {
|
||||||
$result = Json::decode((new Key($this->dataTable, $token))->getValue());
|
$result = Json::decode((new Key($this->dataTable, $token))->getValue());
|
||||||
|
if ($result === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$entity = new RefreshTokenEntity($this->server);
|
$entity = new RefreshTokenEntity($this->server);
|
||||||
$entity->setId($result['id']);
|
$entity->setId($result['id']);
|
||||||
|
@ -16,6 +16,18 @@ class OauthRefreshTokenCest {
|
|||||||
$this->route = new OauthRoute($I);
|
$this->route = new OauthRoute($I);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInvalidRefreshToken(OauthSteps $I) {
|
||||||
|
$this->route->issueToken($this->buildParams(
|
||||||
|
'some-invalid-refresh-token',
|
||||||
|
'ely',
|
||||||
|
'ZuM1vGchJz-9_UZ5HC3H3Z9Hg5PzdbkM'
|
||||||
|
));
|
||||||
|
$I->canSeeResponseContainsJson([
|
||||||
|
'error' => 'invalid_request',
|
||||||
|
'message' => 'The refresh token is invalid.',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function testRefreshToken(OauthSteps $I) {
|
public function testRefreshToken(OauthSteps $I) {
|
||||||
$refreshToken = $I->getRefreshToken();
|
$refreshToken = $I->getRefreshToken();
|
||||||
$this->route->issueToken($this->buildParams(
|
$this->route->issueToken($this->buildParams(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user