PrismaClientValidationError
Invalid
prisma.session.update()
invocation
I am utilizing the latest version of BetterAuth and using the prisma adaptor from better-auth/adaptors/prisma
and my db is postgresql
. I am able to sign up and sign in just fine. However, when the current session needs to be updated, I get the following error. It appears it is trying to use the token for the lookup, but the error seems to indicate the call should be using id instead. My session schema is like this:
How do I resolve this to ensure it is able to properly update the session? Currently, when this error triggers, I just manually go into devtools and delete the cookie (effectively signing me out)

4 Replies
You aren't the only one, as I'm also having the exact same issue with Prisma and MySQL.
(screenshot provided by my colleague)

Hm... So either the issue is with config or schema (though everything looks correct, according to docs) or it's an issue with a higher-order function (not the specific adaptor, since multiple different ones seem "affected", but potentially with a common function that calls the adaptors)
At least in my case, I'm more likely to think that something isn't configured or initialized correctly. I'll re-check everything once more and do some poking about and report back if I have any progress or success. I'll continue looking at this thread in the hope that something will come up and someone can tell me what I'm doing wrong. More info (implementation etc.) is available if anyone asks.
Make token unique property
I'll try that. In the docs, it specifies that token is simply a required string (not unique) but it makes sense it would be. Thanks.