SQL error when exchanging the token (Microsoft Auth + MSSQL + NextJS)
Hello!
I am trying to switch from AuthJS to better-auth but i am stuck with an SQL error.
It happens on the
http://localhost:3000/api/auth/callback/microsoft callback (with the code parameter).
It looks like better-auth is trying to save some data received from Microsoft with an unexpected format
I didn't find any similar issue on the internet
I tried to re-run npx @better-auth/cli@latest migrate --config lib/auth.ts and it says No migrations needed. I can connect the database and the better auth tables are here, so i really don't know what i am supposed to fix.
Can someone help with this issue?
Thanks!
2 Replies
I think if I had to guess somewhere we're calling an
eq check for one field against another, and one being an nvarchar while the other is text.
Can you confirm this in your schema that you include both of these types?I didn't create any custom schema, i guess better-auth mssql implementation is broken