Skip to content

Commit c21ae0c

Browse files
authored
Fix id_token usage as string (#129)
1 parent 27f8530 commit c21ae0c

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

src/Events/XeroAuthorized.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class XeroAuthorized
66
{
77
public string $token;
88
public string $refresh_token;
9-
public array $id_token;
9+
public string $id_token;
1010
public string $expires;
1111
public array $tenants;
1212

tests/Feature/Routes/CallbackTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function test_you_can_get_callback_url()
6262
Event::assertDispatched(XeroAuthorized::class, function (XeroAuthorized $event) {
6363
$this->assertEquals('token', $event->token);
6464
$this->assertEquals('refresh-token', $event->refresh_token);
65-
$this->assertEquals(['token' => 'foo'], $event->id_token);
65+
$this->assertEquals('foo', $event->id_token);
6666
$this->assertEquals('1234', $event->expires);
6767
$this->assertEquals([
6868
[

tests/TestSupport/Mocks/MockAccessToken.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ public function hasExpired()
4040
public function getValues()
4141
{
4242
return [
43-
'id_token' => [
44-
'token' => 'foo',
45-
],
43+
'id_token' => 'foo'
4644
];
4745
}
4846

tests/Unit/CredentialManagersTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ public function test_you_can_get_credential_store_with_existing_data($sutClass,
6363
$createExistingData($sut, $existingData = [
6464
'token' => 'default-token',
6565
'refresh_token' => 'default-refresh-token',
66-
'id_token' => [
67-
'token' => 'foo',
68-
],
66+
'id_token' => 'foo',
6967
'expires' => $expires = strtotime('+1 hour'),
7068
'tenants' => [
7169
[
@@ -126,9 +124,7 @@ public function test_that_it_stores_data_correctly($sutClass, $setupFunction, $c
126124
$this->assertEquals([
127125
'token' => 'token',
128126
'refresh_token' => 'refresh-token',
129-
'id_token' => [
130-
'token' => 'foo',
131-
],
127+
'id_token' => 'foo',
132128
'expires' => '1234',
133129
'tenants' => [
134130
'tenant' => 'tenant_id',
@@ -161,9 +157,7 @@ public function test_that_it_can_refresh_its_token($sutClass, $setupFunction, $c
161157
$this->assertEquals([
162158
'token' => 'token',
163159
'refresh_token' => 'refresh-token',
164-
'id_token' => [
165-
'token' => 'foo',
166-
],
160+
'id_token' => 'foo',
167161
'expires' => '1234',
168162
'tenants' => null,
169163
], $sut->getData());

0 commit comments

Comments
 (0)