Issues with expo and generic oauth provider

Hi,
I'm trying to integrate better-auth with my expo app, using the generic oauth provider.
I noticed a couple of issues:
  1. this part: https://github.com/better-auth/better-auth/blob/main/packages/expo/src/index.ts#L37 never seems to be true since the path is /oauth2/callback . For now I work around this by manually patching the library, but a more robust solution is probably warrented.
  2. I'm using authClient.useSession to get the state while the user is signing in. And indeed when I call authClient.signIn.oauth2 I get the login modal on ios (APP wants to use URL to Sign In). However, the isPending field of the session quickly toggles to
    true
    (expected) and then just as quickly toggles to false, even though I haven't even had the time to click on the modal (unexpected). This is odd, I'd expect isPending to stay
    true
    until either the sign in is completed, errored or aborted.
  3. Likely related to #2 but after successful sign in, the redirect specified in callbackURL does not work within the app, it just stays on the same page.
    Is this a bug or an issue on my end?
GitHub
The most comprehensive authentication framework for TypeScript - better-auth/better-auth
Was this page helpful?