Skip to content

Commit e670217

Browse files
V48 Gate 3 (implementation-only): stalled wallet-auth redirect exposes its authorize URL + manual continuation
Diagnosis so far (staging Supabase auth logs): the browser click never issues the /auth/v1/authorize request — GoTrue itself is correctly configured (a direct probe 302s to the bitcode.exchange /tps/wallet/authorize page). The stall is client-side between building the authorize URL and the navigation leaving the page. The panel now logs the exact authorize URL ([Bitcode QA] 'oauth-redirect' / 'oauth-redirect-stalled' events) and, when the redirect watchdog fires, renders an 'Open Bitcoin authentication manually' link carrying that URL inside the error alert — a user-gesture navigation that both works around and pinpoints whatever is cancelling the programmatic assign. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0b3f0ef commit e670217

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

uapi/app/auxillaries/components/AuxillariesWalletConnectionPanel.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export default function AuxillariesWalletConnectionPanel({
9999
useEffect(() => {
100100
walletAuthStatusRef.current = walletAuthStatus;
101101
}, [walletAuthStatus]);
102+
const [pendingAuthorizeUrl, setPendingAuthorizeUrl] = useState<string | null>(null);
102103
const [walletProviderOptions, setWalletProviderOptions] = useState<BitcoinWalletProviderSummary[]>([]);
103104
const [walletProviderScanStatus, setWalletProviderScanStatus] = useState<'checking' | 'ready' | 'none'>('checking');
104105
const [walletIdentityDetails, setWalletIdentityDetails] = useState<LocalBitcodeWalletIdentity | null>(() =>
@@ -229,8 +230,9 @@ export default function AuxillariesWalletConnectionPanel({
229230
};
230231
}
231232

233+
bitcodeQaTelemetry('info', 'wallet-auxillary', 'oauth-redirect', { url: data.url });
232234
window.location.assign(data.url);
233-
return { ready: false as const, pendingRedirect: true as const };
235+
return { ready: false as const, pendingRedirect: true as const, authorizeUrl: data.url };
234236
} catch (error) {
235237
return {
236238
ready: false as const,
@@ -391,6 +393,7 @@ export default function AuxillariesWalletConnectionPanel({
391393

392394
const handleConnectBitcoinWallet = async (providerId?: BitcoinWalletProviderId) => {
393395
setWalletAuthError(null);
396+
setPendingAuthorizeUrl(null);
394397
const providerLabel =
395398
walletProviderOptions.find((provider) => provider.id === providerId)?.label ??
396399
(providerId ? providerId : 'first available Bitcoin wallet');
@@ -411,10 +414,13 @@ export default function AuxillariesWalletConnectionPanel({
411414
if (walletAuthStatusRef.current !== 'requesting') return;
412415
setWalletAuthStatus('idle');
413416
setWalletAuthNotice(null);
417+
setPendingAuthorizeUrl(sessionReadiness.authorizeUrl ?? null);
414418
setWalletAuthError(
415-
'The Supabase Bitcoin authentication page did not open. Check redirect blocking and that the Supabase this environment points at has the custom:bitcode-bitcoin provider configured, then retry.',
419+
'The Supabase Bitcoin authentication redirect has not completed — the request never left this page. Continue manually below, and check the [Bitcode QA] console trace (?bitcode_verbose=true) for the exact redirect target.',
416420
);
417-
bitcodeQaTelemetry('warn', 'wallet-auxillary', 'oauth-redirect-stalled');
421+
bitcodeQaTelemetry('warn', 'wallet-auxillary', 'oauth-redirect-stalled', {
422+
url: sessionReadiness.authorizeUrl ?? null,
423+
});
418424
}, 8_000);
419425
return;
420426
}
@@ -599,12 +605,20 @@ export default function AuxillariesWalletConnectionPanel({
599605
</button>
600606
</div>
601607
{walletAuthError ? (
602-
<p
608+
<div
603609
role="alert"
604610
className="mt-3 border border-amber-300/24 bg-amber-400/10 px-4 py-3 text-sm leading-6 text-amber-100"
605611
>
606-
{walletAuthError}
607-
</p>
612+
<p>{walletAuthError}</p>
613+
{pendingAuthorizeUrl ? (
614+
<a
615+
href={pendingAuthorizeUrl}
616+
className="mt-2 inline-flex items-center border border-amber-300/34 bg-amber-400/14 px-3 py-1.5 text-[11px] font-semibold uppercase tracking-[0.18em] text-amber-50 transition hover:border-amber-300/54 hover:bg-amber-400/22"
617+
>
618+
Open Bitcoin authentication manually
619+
</a>
620+
) : null}
621+
</div>
608622
) : null}
609623
<div className="mt-3 rounded-2xl border border-white/10 bg-black/18 px-4 py-3 text-sm leading-6 text-white/68">
610624
<span className="font-semibold text-white/82">

0 commit comments

Comments
 (0)