feat(react): enable OAuth in React Native#80
Merged
Conversation
This was referenced Apr 2, 2026
3ebc21a to
eab2596
Compare
accf679 to
d265505
Compare
eab2596 to
5c951dd
Compare
d265505 to
ef7beaa
Compare
5c951dd to
6ca2eba
Compare
6cee6db to
cce8e30
Compare
ad00a9e to
358ac5e
Compare
SahilVasava
reviewed
Apr 28, 2026
This was referenced Apr 29, 2026
SahilVasava
reviewed
Apr 29, 2026
SahilVasava
reviewed
Apr 29, 2026
SahilVasava
reviewed
Apr 29, 2026
SahilVasava
reviewed
Apr 29, 2026
SahilVasava
reviewed
Apr 29, 2026
SahilVasava
reviewed
Apr 29, 2026
Collaborator
SahilVasava
left a comment
There was a problem hiding this comment.
Architecture is right — pluggable getSessionId is a much cleaner native story than what the old design could have grown into. Five inline notes:
- 🟡 No timeout on
getSessionIdWeb— promise hangs on stuck popups - 🟡
popup.closedchecked before URL — closed-vs-success race - 🟡 Native
dismissBrowser()only on success — auth tab stays open on error - 🟡 Same
returnTopath-drop as #143 fixed — cherry-pick when rebasing - 🟡
Variablestype only in this hook — drop by aligning action'sParameters
Nothing blocking the architectural direction; all addressable in this PR or follow-ups.
167a4f2 to
b9acfc8
Compare
31c7756 to
fed766a
Compare
7415541 to
6b21283
Compare
6b21283 to
bce6dbe
Compare
e3ffa73 to
c50c4eb
Compare
bce6dbe to
718a845
Compare
718a845 to
8944716
Compare
c50c4eb to
0581bb2
Compare
8944716 to
425ad67
Compare
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
OmarBasem
pushed a commit
that referenced
this pull request
May 14, 2026
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.
This PR is part of a stack created with Aviator.
mainCloses FS-1922, FS-2000
This PR comes after #124. So make sure you review #124 before this one if you want to go in a chronological order.
Update: Changed this PR to be on top of the stack and added Passkeys and Android setup before this. This way this PR can be tested by just running
pnpm androidand using the Android Emulator.Refactored the OAuth implementation in
wallet-reactto be more contained in a single place so it's easier to create web and mobile modules for it.The new structure of the
authenticateOAuthaction looks like this:The main change is the behavior of the web OAuth flow. The new code doesn't rely on using
postMessageand a message listener anymore. It instead polls for the URL change of the popup. The main advantage of this is that we don't need any of the additional code that we had in the old logic where the popup had to open, load the app, run JS to detect the OAuth callback and complete the auth with thesessionId. We can do that all in thegetSessionIdWebmodule. This meant that we could get rid of the OAuth related code inconnector.ts.So the new logic just checks the URL of the popup every 250ms and if it's on the same origin (same URL as the app) then it tries to get the sessionId param off of the query params.
An additional security advantage to this is that checking for same origin is implicit as we can't get the popup's URL across origins. So if the popup is still on the Google OAuth flow the check errors on
popup.location.hrefalready. In the old flow we had to make sure to check fororigin === expectedOriginto be secure.