From 90b375bfdc5a7d153a48871a8734d0bc18a788d7 Mon Sep 17 00:00:00 2001 From: Glen Maddern Date: Tue, 25 Mar 2025 11:55:43 +1100 Subject: [PATCH] Switched from "localhost" to "127.0.0.1" for local redirect --- src/cli/shared.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/shared.ts b/src/cli/shared.ts index a4101aa..b146abd 100644 --- a/src/cli/shared.ts +++ b/src/cli/shared.ts @@ -44,7 +44,7 @@ export class NodeOAuthClientProvider implements OAuthClientProvider { } get redirectUrl(): string { - return `http://localhost:${this.options.callbackPort}${this.callbackPath}` + return `http://127.0.0.1:${this.options.callbackPort}${this.callbackPath}` } get clientMetadata() { @@ -229,7 +229,7 @@ export function setupOAuthCallbackServer(options: OAuthCallbackServerOptions) { }) const server = app.listen(options.port, () => { - console.error(`OAuth callback server running at http://localhost:${options.port}`) + console.error(`OAuth callback server running at http://127.0.0.1:${options.port}`) }) /** @@ -299,7 +299,7 @@ export async function parseCommandLineArgs(args: string[], defaultPort: number, } const url = new URL(serverUrl) - const isLocalhost = url.hostname === 'localhost' && url.protocol === 'http:' + const isLocalhost = (url.hostname === 'localhost' || url.hostname === '127.0.0.1') && url.protocol === 'http:' if (!(url.protocol == 'https:' || isLocalhost)) { console.error(usage)