From b1e082a7d3ebe8b90a7ea0d24744ac0de1403410 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Fri, 28 Aug 2026 09:20:47 +0800 Subject: [PATCH] fix(auth): handle OIDC callbacks from embedded sign-in --- app/authentication/AuthFlow.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/authentication/AuthFlow.tsx b/app/authentication/AuthFlow.tsx index 5aca0a7..d57a535 100644 --- a/app/authentication/AuthFlow.tsx +++ b/app/authentication/AuthFlow.tsx @@ -1261,6 +1261,12 @@ function OidcStep({ if (!navState.loading) setUrl(navState.url); }; + const handleWebViewRequest = (request: { url: string }) => { + if (!request.url.startsWith(OIDC_CALLBACK_URL)) return true; + void handleCallbackUrl(request.url); + return false; + }; + const handleError = (syntheticEvent: any) => { const { nativeEvent } = syntheticEvent; if ( @@ -1456,6 +1462,7 @@ function OidcStep({ style={{ flex: 1, backgroundColor: bg }} containerStyle={{ backgroundColor: bg }} onNavigationStateChange={handleNav} + onShouldStartLoadWithRequest={handleWebViewRequest} onMessage={onMessage} onError={handleError} injectedJavaScript={injectedJavaScript}