Fixes #11. Strip slashes from profile UUID in the authserver's response

This commit is contained in:
ErickSkrauch 2021-02-18 00:41:38 +01:00
parent 1fee15f74a
commit 9c6d9409ea
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class AuthenticateData {
'accessToken' => $this->accessToken,
'clientToken' => $this->clientToken,
'selectedProfile' => [
'id' => $this->account->uuid,
'id' => str_replace('-', '', $this->account->uuid),
'name' => $this->account->username,
'legacy' => false,
],

View File

@ -27,9 +27,9 @@ class AuthenticationFormTest extends TestCase {
$authForm->password = 'password_0';
$authForm->clientToken = Uuid::uuid4()->toString();
$result = $authForm->authenticate()->getResponseData();
$this->assertRegExp('/^[\w=-]+\.[\w=-]+\.[\w=-]+$/', $result['accessToken']);
$this->assertMatchesRegularExpression('/^[\w=-]+\.[\w=-]+\.[\w=-]+$/', $result['accessToken']);
$this->assertSame($authForm->clientToken, $result['clientToken']);
$this->assertSame('df936908-b2e1-544d-96f8-2977ec213022', $result['selectedProfile']['id']);
$this->assertSame('df936908b2e1544d96f82977ec213022', $result['selectedProfile']['id']);
$this->assertSame('Admin', $result['selectedProfile']['name']);
$this->assertFalse($result['selectedProfile']['legacy']);
$this->assertTrue(OauthSession::find()->andWhere([