Google Sign-In Not Working with `authClient.signIn.social()`
I'm implementing Google authentication using better-auth with React. Here's my setup:
1. Client-side auth client:
2. Server-side auth configuration:
3. Sign-in component:
Issue:
When I click the sign-in button, nothing seems to happen. I've configured my Google OAuth credentials and environment variables, but the authentication flow isn't starting.
Questions:
Am I missing any configuration steps?
Is there a way to debug the authentication flow?
Should I be handling the response from authClient.signIn.social() differently?
Environment:
better-auth (latest version)
React
TypeScript
React Router
3 Replies
have you mounted the auth handler to the server? You'd need to define I think an Action and a loader on a get catch all route
can I define the action in the same route
/signin
?
I tried and for some reason the request passed to the handler results in another error:
not on your /sign-in page but on a catch call route under
/api/auth
path. Check how you define a catch all route in react router