fix(McpOAuthClientProvider): update redirect URL (#5449)

fix(McpOAuthClientProvider): update redirect URL to use 127.0.0.1 instead of localhost
This commit is contained in:
SuYao 2025-04-29 01:40:08 +08:00 committed by GitHub
parent d64ae18bfc
commit db7a7e2c2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ export class CallBackServer {
if (req.url?.startsWith(path)) { if (req.url?.startsWith(path)) {
try { try {
// Parse the URL to extract the authorization code // Parse the URL to extract the authorization code
const url = new URL(req.url, `http://localhost:${port}`) const url = new URL(req.url, `http://127.0.0.1:${port}`)
const code = url.searchParams.get('code') const code = url.searchParams.get('code')
if (code) { if (code) {
// Emit the code event // Emit the code event

View File

@ -27,7 +27,7 @@ export class McpOAuthClientProvider implements OAuthClientProvider {
} }
get redirectUrl(): string { get redirectUrl(): string {
return `http://localhost:${this.config.callbackPort}${this.config.callbackPath}` return `http://127.0.0.1:${this.config.callbackPort}${this.config.callbackPath}`
} }
get clientMetadata() { get clientMetadata() {