[PR #636] [CLOSED] feat: improve social auth with idToken on expo #11655

Closed
opened 2026-04-13 07:55:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/636
Author: @pakenfit
Created: 11/23/2024
Status: Closed

Base: mainHead: feature/enchance-social-idtoken-auth-expo


📝 Commits (2)

  • 1e311df feat: improve social auth with idToken on expo
  • 9d99a2b Merge branch 'better-auth:main' into feature/enchance-social-idtoken-auth-expo

📊 Changes

4 files changed (+73 additions, -4 deletions)

View changed files

📝 packages/better-auth/src/api/routes/sign-in.ts (+1 -0)
📝 packages/expo/src/client.ts (+14 -4)
📝 packages/expo/src/expo.test.ts (+32 -0)
📝 packages/expo/src/index.ts (+26 -0)

📄 Description

This PR enhances the google and apple social auth on expo using for example expo-apple-authentication and @react-native-google-signin/google-signin

It consists on:

  • After gettting the idToken from expo-apple-authentication or @react-native-google-signin/google-signin
  • Use social auth with idToken in body :
await authClient.signIn.social({
   provider: "google",
   callbackURL: "/home-screen",
   idToken: {
       token: response.data.idToken,
    },
});
  • The server returns the session data, user and a boolean idToken: true indicates the auth with idToken
  • The expo plugin server side intercepts the response and add cookie to the response body.
  • The expo plugin client side store the cookie in the secure storage.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/636 **Author:** [@pakenfit](https://github.com/pakenfit) **Created:** 11/23/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/enchance-social-idtoken-auth-expo` --- ### 📝 Commits (2) - [`1e311df`](https://github.com/better-auth/better-auth/commit/1e311df5541eeaecd4ea4b389886c71587cd7b41) feat: improve social auth with idToken on expo - [`9d99a2b`](https://github.com/better-auth/better-auth/commit/9d99a2be0d06f4f2292af5223aac2283b654d496) Merge branch 'better-auth:main' into feature/enchance-social-idtoken-auth-expo ### 📊 Changes **4 files changed** (+73 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+1 -0) 📝 `packages/expo/src/client.ts` (+14 -4) 📝 `packages/expo/src/expo.test.ts` (+32 -0) 📝 `packages/expo/src/index.ts` (+26 -0) </details> ### 📄 Description This PR enhances the `google` and `apple` social auth on `expo` using for example `expo-apple-authentication` and `@react-native-google-signin/google-signin` It consists on: - After gettting the `idToken` from `expo-apple-authentication` or `@react-native-google-signin/google-signin` - Use social auth with idToken in body : ```` await authClient.signIn.social({ provider: "google", callbackURL: "/home-screen", idToken: { token: response.data.idToken, }, }); ```` - The server returns the session data, user and a boolean `idToken: true` indicates the auth with `idToken` - The expo plugin server side intercepts the response and add cookie to the response body. - The expo plugin client side store the cookie in the secure storage. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 07:55:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#11655