Skip to content

Fix iOS OAuth redirect stuck on success screen#444

Merged
AnthonyRonning merged 2 commits intomasterfrom
fix/ios-oauth-redirect
Feb 26, 2026
Merged

Fix iOS OAuth redirect stuck on success screen#444
AnthonyRonning merged 2 commits intomasterfrom
fix/ios-oauth-redirect

Conversation

@AnthonyRonning
Copy link
Contributor

@AnthonyRonning AnthonyRonning commented Feb 26, 2026

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

  • Show a tappable "Open Maple" button after auth completes, so the user can trigger the deep link redirect via a user gesture (which iOS allows)
  • The auto-redirect attempt is kept as a best-effort fallback for desktop

Other

  • Xcode project pbxproj: update LIBRARY_SEARCH_PATHS from TOOLCHAIN_DIR to DEVELOPER_DIR paths

Open with Devin

Summary by CodeRabbit

Release Notes

  • New Features
    • Enhanced authentication flow for native app users, now featuring automatic redirection after successful login with a processing indicator.
    • Added confirmation card providing a manual fallback button for users to open the native application if automatic redirection doesn't complete.
    • Updated authentication success messaging to guide users through the new native app integration flow.

AnthonyRonning and others added 2 commits February 25, 2026 20:03
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>
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

Modified 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

Cohort / File(s) Summary
Native App Deep-Link Redirect
frontend/src/routes/auth.$provider.callback.tsx
Added nativeRedirectUrl state variable to store deep link for native apps. Introduced logic to compute and store deep link URL on successful Tauri auth. Added two new UI branches: confirmation card when native redirect URL exists, and processing UI with loading indicator in redirect-to-native mode. Updated button labels and success messages to reflect manual open flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Maple#103: Implements the same native "redirect-to-native" deep-link flow for OAuth, including storing and reading the flag for deep-link redirection.
  • Maple#45: Modifies the same OAuth callback file to add native/desktop deep-link handling and UI for redirecting to the native app.

Poem

🐰 A link deep in the native land,
New state helps us understand,
Confirm and open with flair,
Maple hops with redirect care! ✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main problem solved by the PR: iOS OAuth redirect getting stuck on the success screen after authentication completes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ios-oauth-redirect

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

Deploying maple with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Native 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-native is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2323480 and eb9b7e4.

⛔ Files ignored due to path filters (1)
  • frontend/src-tauri/gen/apple/maple.xcodeproj/project.pbxproj is excluded by !**/gen/**
📒 Files selected for processing (1)
  • frontend/src/routes/auth.$provider.callback.tsx

@AnthonyRonning
Copy link
Contributor Author

@TestFlight build

@github-actions
Copy link
Contributor

🚀 TestFlight deployment triggered! Check the Actions tab for progress.

@AnthonyRonning AnthonyRonning merged commit 2af8046 into master Feb 26, 2026
15 checks passed
@AnthonyRonning AnthonyRonning deleted the fix/ios-oauth-redirect branch February 26, 2026 02:12
@github-actions
Copy link
Contributor

✅ TestFlight deployment completed successfully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant