From c3b253796cbbb3a87476f6ee14622cf6d1c5efc1 Mon Sep 17 00:00:00 2001 From: keurcien Date: Sun, 27 Jul 2025 17:21:15 +0200 Subject: [PATCH] Avoid retry everytime --- src/mcp/client/auth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mcp/client/auth.py b/src/mcp/client/auth.py index 775fb0f6c..17d2558f7 100644 --- a/src/mcp/client/auth.py +++ b/src/mcp/client/auth.py @@ -131,7 +131,7 @@ def is_token_valid(self) -> bool: and self.current_tokens.access_token and (not self.token_expiry_time or time.time() <= self.token_expiry_time) ) - + def can_refresh_token(self) -> bool: """Check if token can be refreshed.""" return bool(self.current_tokens and self.current_tokens.refresh_token and self.client_info) @@ -546,6 +546,6 @@ async def async_auth_flow(self, request: httpx.Request) -> AsyncGenerator[httpx. logger.exception("OAuth flow error") raise - # Retry with new tokens - self._add_auth_header(request) - yield request + # Retry with new tokens + self._add_auth_header(request) + yield request