Skip to content

Commit f795813

Browse files
committed
Set expiration timestamp in authorization records
Related to #15
1 parent d273d48 commit f795813

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Classes/Authorization.php

+5
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ public function setEncryptedSerializedAccessToken(string $encryptedSerializedAcc
228228
*/
229229
public function setAccessToken(AccessTokenInterface $accessToken): void
230230
{
231+
$expirationTimestamp = $accessToken->getExpires();
232+
if ($expirationTimestamp) {
233+
$this->setExpires(\DateTimeImmutable::createFromFormat('U', (string)$expirationTimestamp));
234+
}
235+
231236
try {
232237
if ($this->encryptionService !== null && $this->encryptionService->isConfigured()) {
233238
$this->encryptedSerializedAccessToken = $this->encryptionService->encryptAndEncode(json_encode($accessToken, JSON_THROW_ON_ERROR, 512));

0 commit comments

Comments
 (0)