From 01988989793539ca78082f06e3482961a1950643 Mon Sep 17 00:00:00 2001 From: Nicholai Date: Mon, 16 Feb 2026 23:51:07 -0700 Subject: [PATCH] fix(auth): noopener returns null popup reference window.open with noopener returns null, so the subsequent location.href assignment was a no-op. Open without noopener, then null out opener manually before navigating. --- src/components/settings/ai-model-tab.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/settings/ai-model-tab.tsx b/src/components/settings/ai-model-tab.tsx index 8bedda5..9406728 100755 --- a/src/components/settings/ai-model-tab.tsx +++ b/src/components/settings/ai-model-tab.tsx @@ -318,11 +318,15 @@ function ProviderConfigSection({ const handleOAuthConnect = async (): Promise => { // Open window immediately in the click handler to avoid - // popup blockers (async gap kills the user gesture) - const popup = window.open("about:blank", "_blank", "noopener") + // popup blockers (async gap kills the user gesture). + // Can't use noopener here — it makes window.open return null. + const popup = window.open("about:blank", "_blank") const { verifier, challenge } = await generatePKCE() const url = buildAuthUrl(challenge) - if (popup) popup.location.href = url + if (popup) { + popup.opener = null + popup.location.href = url + } setOAuth({ step: "connecting", verifier }) }