Skip to content

Commit c9cae41

Browse files
committed
Set token_expiry_time upon context initialization
1 parent a3a4b8d commit c9cae41

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/mcp/client/auth/oauth2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ async def _initialize(self) -> None: # pragma: no cover
467467
"""Load stored tokens and client info."""
468468
self.context.current_tokens = await self.context.storage.get_tokens()
469469
self.context.client_info = await self.context.storage.get_client_info()
470+
471+
if self.context.current_tokens and self.context.current_tokens.expires_in:
472+
self.context.update_token_expiry(self.context.current_tokens)
473+
470474
self._initialized = True
471475

472476
def _add_auth_header(self, request: httpx.Request) -> None:

0 commit comments

Comments
 (0)