Реорганизована выдача JWT токенов

Добавлен механизм сохранения сессий и refresh_token
This commit is contained in:
ErickSkrauch
2016-05-30 02:44:17 +03:00
parent 98c01625d1
commit bdc96d82c1
34 changed files with 676 additions and 73 deletions

View File

@@ -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');
}
}
}