mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Реорганизована выдача JWT токенов
Добавлен механизм сохранения сессий и refresh_token
This commit is contained in:
@@ -34,8 +34,8 @@ class FunctionalTester extends Actor {
|
||||
}
|
||||
|
||||
$this->canSeeResponseIsJson();
|
||||
$this->canSeeResponseJsonMatchesJsonPath('$.jwt');
|
||||
$jwt = $this->grabDataFromResponseByJsonPath('$.jwt')[0];
|
||||
$this->canSeeAuthCredentials(false);
|
||||
$jwt = $this->grabDataFromResponseByJsonPath('$.access_token')[0];
|
||||
$this->amBearerAuthenticated($jwt);
|
||||
}
|
||||
|
||||
@@ -43,4 +43,14 @@ class FunctionalTester extends Actor {
|
||||
$this->haveHttpHeader('Authorization', null);
|
||||
}
|
||||
|
||||
public function canSeeAuthCredentials($expectRefresh = false) {
|
||||
$this->canSeeResponseJsonMatchesJsonPath('$.access_token');
|
||||
$this->canSeeResponseJsonMatchesJsonPath('$.expires_in');
|
||||
if ($expectRefresh) {
|
||||
$this->canSeeResponseJsonMatchesJsonPath('$.refresh_token');
|
||||
} else {
|
||||
$this->cantSeeResponseJsonMatchesJsonPath('$.refresh_token');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user