-
-
Notifications
You must be signed in to change notification settings - Fork 496
Description
Provide environment information
System: OS: macOS 15.5 CPU: (14) arm64 Apple M4 Pro Memory: 116.08 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm pnpm: 9.6.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm
Describe the bug
When using better-auth with Discord OAuth in the React Native/Expo app, cookies are being set and returned correctly, but the session object remains null. The authentication flow appears to work (user gets redirected back, cookies are present), but useSession(), getSession(), and listSessions() all return null/empty results.
Link to reproduction
https://github.com/t3-oss/create-t3-turbo
To reproduce
- Fresh install of create-t3-turbo template
- Configure better-auth with Discord OAuth provider
- Run Expo development server
- Attempt to sign in with Discord
- Observe that cookies are set but session is null
Additional information
Expected behavior
After successful Discord OAuth flow, the session should be populated with user data.
Actual behavior
`LOG session null
LOG getSession result {"_h": 0, "_i": 0, "_j": null, "_k": null}
LOG listSessions result {"_h": 0, "_i": 0, "_j": null, "_k": null}
LOG cookies ; __Secure-better-auth.session_token=PVuP6dAgjwv......