From 6d926156f193209a24375f351fbfb763c638f612 Mon Sep 17 00:00:00 2001 From: Wim Griffioen Date: Mon, 24 Feb 2025 12:31:03 +0100 Subject: [PATCH] Mark long-lived tokens as expired after July 1st After July 1st, 2025 the API will stop issuing long-lived access tokens and existing tokens will be revoked. The SDK will automatically refresh all access tokens which expire more than 10 minutes in the future after July 1st. --- src/Connection.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Connection.php b/src/Connection.php index 1fec7d5..48ea976 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -289,6 +289,12 @@ public function checkOrAcquireAccessToken(): void public function tokenHasExpired(): bool { + // Starting July 1st, 2025 only short-lived access tokens will be issued from the API. This will invalidate all + // tokens issued before July 1st with a lifespan longer than 10 minutes. + if (time() > 1751320800 && $this->tokenExpires > time() + 600) { + return true; + } + return $this->tokenExpires - 10 < time(); }