Weird behaviour when logging in with Discord
Hey, I am using Better Auth with latest Next.js and I have this weird "bug (?)" when logging in with Discord. Discord is my only option to log in with.
When I click the login button, which I have tried two approaches:
The
When I start my local server and click the login button, I get an error, however without any message. This is the output in the dev tools console after I click it:
What's weird is that the button starts to work after I modify either the
I have built the authentication using the documentation and all of the code for auth comes from there too.
Does anyone know what the issue could be?
When I click the login button, which I have tried two approaches:
- Client component with a button that has an async
onClick()event which awaits thesignIn()function fromauth-client.ts. - Same as the first one, but with a server action instead.
The
signIn() function looks like this:When I start my local server and click the login button, I get an error, however without any message. This is the output in the dev tools console after I click it:
What's weird is that the button starts to work after I modify either the
onSuccess() or onError() function, just another console.log() is enough. Then it starts to work again.I have built the authentication using the documentation and all of the code for auth comes from there too.
Does anyone know what the issue could be?