Skip to content

Commit

Permalink
Fix treating TTL of access token as expiration timestamp (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
robskr authored Sep 28, 2024
1 parent 2764a52 commit f729862
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Auth/ApiKeyCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public function provide(GoSms $goSms): Token
];
$token = $goSms->auth()->authorize($body);

return new Token($token->accessToken, $token->expiresIn);
return new Token($token->accessToken, time() + $token->expiresIn);
}
}
2 changes: 1 addition & 1 deletion tests/Auth/ApiKeyCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public function testProvide(): void
$token = $credentials->provide($goSms);

self::assertSame('moo', $token->getToken());
self::assertSame(123, $token->getExp());
self::assertSame(123, $token->getTtl());
}
}

0 comments on commit f729862

Please sign in to comment.