Skip to content

Commit 32c6b9a

Browse files
authored
Merge pull request #1 from keurcien/fix/retry-refresh-token
Avoid retry everytime
2 parents 959d4e3 + c3b2537 commit 32c6b9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mcp/client/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def is_token_valid(self) -> bool:
131131
and self.current_tokens.access_token
132132
and (not self.token_expiry_time or time.time() <= self.token_expiry_time)
133133
)
134-
134+
135135
def can_refresh_token(self) -> bool:
136136
"""Check if token can be refreshed."""
137137
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.
546546
logger.exception("OAuth flow error")
547547
raise
548548

549-
# Retry with new tokens
550-
self._add_auth_header(request)
551-
yield request
549+
# Retry with new tokens
550+
self._add_auth_header(request)
551+
yield request

0 commit comments

Comments
 (0)