SyntaxError: "[object Object]" is not valid JSON on Google oauth callback
I'm trying to setup google oauth login and I'm receiving a strange error when the provider calls the callback URL. What I get in my server logs (I've added some logging in the library code):
the library code at the top of the stack is this function:
when I remove the JSON.parse call in that function I am able to complete the oauth sign in sucessfully.
Info about my environment:
better-auth 1.2.8 (had the same issue on 1.2.7 and tried upgrading)
hono 4.7.8
Is this a bug in the library or in my setup? Confused how the library expects a json string there but its already an object. Thanks in advance!
the library code at the top of the stack is this function:
when I remove the JSON.parse call in that function I am able to complete the oauth sign in sucessfully.
Info about my environment:
better-auth 1.2.8 (had the same issue on 1.2.7 and tried upgrading)
hono 4.7.8
Is this a bug in the library or in my setup? Confused how the library expects a json string there but its already an object. Thanks in advance!
Solution
Sorry, this was a problem on my side. I had the kysely plugin
ParseJSONResultsPlugin enabled on the adapter