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:

model Session {
  id             String   @id
  userId         String
  user           User     @relation(fields: [userId], references: [id], onDelete: Cascade)
  expiresAt      DateTime
  token          String
  ipAddress      String?
  userAgent      String?
  impersonatedBy String?
  createdAt      DateTime @default(now())
  updatedAt      DateTime @updatedAt

  @@map("sessions")
}


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)
image.png
image.png
Was this page helpful?