Skip to content

Commit 6f73e93

Browse files
committed
fix(auth): apply URL sanitization when opening authorization link
1 parent e141b47 commit 6f73e93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/services/mcp/oauth/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { loggerService } from '@logger'
44
import { getConfigDir } from '@main/utils/file'
55
import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth'
66
import { OAuthClientInformation, OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/sdk/shared/auth'
7-
import { sanitizeUrl } from 'strict-url-sanitise'
87
import open from 'open'
8+
import { sanitizeUrl } from 'strict-url-sanitise'
99

1010
import { JsonFileStorage } from './storage'
1111
import { OAuthProviderOptions } from './types'
@@ -63,7 +63,7 @@ export class McpOAuthClientProvider implements OAuthClientProvider {
6363
async redirectToAuthorization(authorizationUrl: URL): Promise<void> {
6464
try {
6565
// Open the browser to the authorization URL
66-
await open(authorizationUrl.toString())
66+
await open(sanitizeUrl(authorizationUrl.toString()))
6767
logger.debug('Browser opened automatically.')
6868
} catch (error) {
6969
logger.error('Could not open browser automatically.')

0 commit comments

Comments
 (0)