Fix iOS OAuth redirect stuck on success screen#444
Conversation
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
iOS Safari blocks programmatic custom URL scheme redirects without a user gesture. Add a tappable button as fallback when auto-redirect fails. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
📝 WalkthroughWalkthroughModified OAuth callback component to support native app deep-link redirect functionality. Added state to track native redirect URL. Implemented conditional UI branches for native redirect confirmation and processing states while maintaining existing web authentication flow behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Deploying maple with
|
| Latest commit: |
eb9b7e4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://940e06fa.maple-ca8.pages.dev |
| Branch Preview URL: | https://fix-ios-oauth-redirect.maple-ca8.pages.dev |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/routes/auth.$provider.callback.tsx (1)
180-194:⚠️ Potential issue | 🟠 MajorNative processing guard can hide real auth errors.
Line 180 renders the native “processing” card even when processing is done and an error exists, as long as
redirect-to-nativeis still in localStorage. That can trap users on a spinner instead of showing the failure state.💡 Proposed fix
- if (localStorage.getItem("redirect-to-native") === "true") { + if (isProcessing && localStorage.getItem("redirect-to-native") === "true") {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/routes/auth`.$provider.callback.tsx around lines 180 - 194, The native "processing" card is shown solely based on localStorage.getItem("redirect-to-native") which can hide authentication errors; update the guard around rendering the Card (the block that references localStorage.getItem("redirect-to-native"), formattedProvider, and Loader2) to only show the native processing UI when processing is still active and there is no auth error (e.g., combine the redirect-to-native check with the existing "isProcessing" state and a check that "error" is falsy), and ensure you clear the "redirect-to-native" key when processing completes or an error occurs so users won't be stuck on the spinner.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@frontend/src/routes/auth`.$provider.callback.tsx:
- Around line 180-194: The native "processing" card is shown solely based on
localStorage.getItem("redirect-to-native") which can hide authentication errors;
update the guard around rendering the Card (the block that references
localStorage.getItem("redirect-to-native"), formattedProvider, and Loader2) to
only show the native processing UI when processing is still active and there is
no auth error (e.g., combine the redirect-to-native check with the existing
"isProcessing" state and a check that "error" is falsy), and ensure you clear
the "redirect-to-native" key when processing completes or an error occurs so
users won't be stuck on the spinner.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
frontend/src-tauri/gen/apple/maple.xcodeproj/project.pbxprojis excluded by!**/gen/**
📒 Files selected for processing (1)
frontend/src/routes/auth.$provider.callback.tsx
|
@TestFlight build |
|
🚀 TestFlight deployment triggered! Check the Actions tab for progress. |
|
✅ TestFlight deployment completed successfully! |
Problem
iOS Safari blocks programmatic custom URL scheme redirects (
window.location.href = "cloud.opensecret.maple://...") when not triggered by a user gesture. After Google/GitHub OAuth completes, the callback page gets stuck on the "Authentication Successful" screen.Fix
Other
TOOLCHAIN_DIRtoDEVELOPER_DIRpathsSummary by CodeRabbit
Release Notes