Reduce OAuth state timeout from 10 to 5 minutes for improved security

- Update MCP OAuth state expiration in connection.ts
- Update OpenRouter OAuth state expiration in oauth-provider.ts
- Addresses security review feedback to minimize window for potential attacks
This commit is contained in:
Jerome 2025-06-19 13:40:47 +01:00
commit c9feacd763
No known key found for this signature in database

View file

@ -162,7 +162,7 @@ class MCPOAuthProvider implements OAuthClientProvider {
const oauthState: MCPOAuthState = {
codeVerifier,
state: this.generateRandomString(16),
expiresAt: Date.now() + (10 * 60 * 1000), // 10 minutes
expiresAt: Date.now() + (5 * 60 * 1000), // 5 minutes
};
localStorage.setItem(`mcp_oauth_state_${this.connectionId}`, JSON.stringify(oauthState));
}