Better AuthBA
Better Auth10mo ago
rdx

Error when updating session expiresAt

Hi, whenever better-auth decides to update my session's expiresAt field, it crashes.

Here's the error:
2992 }
  2993 const whereClause = convertWhereClause(model, where);
  2994 const transformed = transformInput(update, model, "update");
→ 2995 const result = await db[getModelName(model)].update({
         where: {
           token: "OXw2gaaza1mxmaSMJU3YK6x8rWqP11cD",
       ?   id?: String,
       ?   token_userId?: SessionTokenUserIdCompoundUniqueInput,
       ?   AND?: SessionWhereInput | SessionWhereInput[],
       ?   OR?: SessionWhereInput[],
       ?   NOT?: SessionWhereInput | SessionWhereInput[],
       ?   createdAt?: DateTimeFilter | DateTime,
       ?   updatedAt?: DateTimeFilter | DateTime,
       ?   expiresAt?: DateTimeFilter | DateTime,
       ?   ipAddress?: StringNullableFilter | String | Null,
       ?   userAgent?: StringNullableFilter | String | Null,
       ?   impersonatedBy?: StringNullableFilter | String | Null,
       ?   userId?: UuidFilter | String,
       ?   User?: UserScalarRelationFilter | UserWhereInput
         },
         data: {
           expiresAt: new Date("2025-03-12T22:37:51.793Z")
         }
       })

Argument `where` of type SessionWhereUniqueInput needs at least one of `id` or `token_userId` arguments. Available options are marked with ?.
2025-03-05T22:37:51.801Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR [Error [PrismaClientValidationError]:


I'm using better-auth v1.2.2 with the Prisma adapter
Was this page helpful?