fix(auth): open mobile OAuth in external browser to keep keyboard working#1115
Open
JamieRuderman wants to merge 1 commit into
Open
fix(auth): open mobile OAuth in external browser to keep keyboard working#1115JamieRuderman wants to merge 1 commit into
JamieRuderman wants to merge 1 commit into
Conversation
…king On mobile, Google/Apple sign-in and sign-out opened the Cognito hosted UI in the in-app browser (SFSafariViewController on iOS). Presenting and dismissing it over the WKWebView leaves the web view unable to raise the soft keyboard, so returning to the sign-in form (e.g. after canceling) broke email/password entry. Open the OAuth/logout URLs in the external system browser instead. The flow already returns via the authCallback/signoutCallback deep link, so the success path is unchanged, and using an external user-agent for OAuth also follows platform best practice (RFC 8252). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uj1HRmSGLKX5sa1pqY1oFY
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On mobile, the soft keyboard fails to appear on the sign-in form after returning from a federated (Google/Apple) sign-in attempt.
Repro: Tap Sign in with Google → cancel the OAuth page → return to the app → tap the email/password field → no keyboard.
Root cause
Google/Apple sign-in (
mobileAuth) and sign-out opened the Cognito hosted UI in Capacitor's in-app browser (Browser.open→SFSafariViewControlleron iOS) viawindowOpen(authUrl, 'auth').On iOS, once an
SFSafariViewControllerhas been presented over theWKWebViewand then dismissed (e.g. the user cancels), the underlying web view can no longer raise the soft keyboard. The fields are enabled (theloadingreset from #1097 works correctly) — the WebView has simply lost the ability to present the keyboard. This path was introduced with the new custom auth UI in #1063.Fix
Open the OAuth and logout URLs in the external system browser instead of the embedded one (passing the existing
externalflag towindowOpen→AppLauncher.openUrl).remoteit://authCallback/signoutCallbackdeep link with the authorization-code response (responseType = 'code'), so the success path is unchanged.Testing notes
Needs a device/simulator check (can't run the mobile app in CI):
Expected UX change: with the external browser, a successful sign-in won't auto-dismiss the browser tab the way the in-app browser did — the app comes to the foreground via the deep link, but the OAuth tab may remain in the background browser. This is standard for this OAuth pattern and is the tradeoff for reliable keyboard behavior.
🤖 Generated with Claude Code
Generated by Claude Code