account->platform->extendsAccessTokenOnRefresh()) { // Instagram/Threads extend the long-lived token itself and // can't be refreshed once expired, so extend it while it's // still valid instead of waiting for it to fail. $verifier->refreshToken($this->account); } else { $verifier->verify($this->account); } } catch (PlatformUnavailableException $e) { Log::warning('Token refresh skipped: platform unavailable', [ 'account_id' => $this->account->id, 'platform' => $this->account->platform->value, 'error' => $e->getMessage(), ]); } catch (TokenExpiredException $e) { $this->account->markAsTokenExpired($e->getMessage()); } catch (Throwable $e) { Log::warning('Proactive token refresh failed', [ 'account_id' => $this->account->id, 'platform' => $this->account->platform->value, 'error' => $e->getMessage(), ]); } } }