fix(rmcp): reject expired OAuth fallback token

This commit is contained in:
Adam Perry
2026-06-05 23:08:28 +00:00
parent 7a3d43e4f6
commit 4b5ccfa24c
+6
View File
@@ -770,6 +770,12 @@ impl RmcpClient {
matches!(auth_err, AuthError::NoAuthorizationSupport)
}) =>
{
if initial_tokens.token_response.0.expires_in() == Some(Duration::ZERO)
{
return Err(anyhow!(
"stored OAuth access token for MCP server `{server_name}` is expired and OAuth metadata discovery is unavailable"
));
}
let access_token = initial_tokens
.token_response
.0