Better Auth Error after upgrade to 1.2.10
there is an error show after sign-in via google in https://www.better-auth.com/ and my website
i try to downgrade and it fixed so the error comes with latest version
any fix?
http://localhost:3000/api/auth/error?error=please_restart_the_process
more info:
18 Replies
Did you get this resolved?
Did you clear your database or anything like that when upgrading by chance?
This should only occur when the provided state value is not found in the database.
no, i didn't .. the problm still exist
When you get the error and it includes the
state
in the console, can you match that against your DB and tell me if your DB truely doesn't have that verification value?I removed
onAPIError
, and the error is gone. Is that okay, or is it bad practice?That's kind of like choosing the ignore the error
i see, can you give me guide to debug please?
Run the error again, then check your DB in the
verification
table to see if your DB actually has this value in the value
field
@yasserconnect
the verification table is empty i don't now why
i try to fix long time ago but still no luck!
what do you mean you tried to fix long time ago? Has it always just had nothing in there or something?
When I installed better-auth in the first beta release, the table existed and had records. After that, no new records were added — it's like the table doesn't exist anymore!
The only issue I noticed in the guide is that the table is called
verification
, but mine is called Verification
.
verification: {
modelName: "Verification",
},Huh.. interesting
Can I see your auth config?
sure. client or server?
Server
Can you rename your
verification
table to be lowercase then? Might make things smoother
And ofc change the auth config
If that fixes it then I may have to go check our code loli try that, still same problem
ERROR [Better Auth]: State Mismatch. Verification not found { state: 'N3giWPXtYwP6Vg5hpuGxNKD6RlF5W0J-' }
GET /api/auth/callback/google?state=N3giWPXtYwP6Vg5hpuGxNKD6RlF5W0J-&code=4%2F0AVMBsJihSeFxV8QYjw3ydGg2M9NAFAlkY5050nnOUUk9OzQgufbzyW8G0RPg-DTXBDCq1w&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=none 302 in 63ms
and the table empty