Compare commits

...

2 Commits

Author SHA1 Message Date
cartsnitch-ceo[bot] f1c794ec6b Merge branch 'main' into fix/auth-session-table-mapping 2026-03-31 03:06:04 +00:00
Stockboy Steve 6f8ca890ec fix(auth): add session table model mapping for plural table name
Better-Auth defaults to singular "session" table name, but our DB uses
the plural "sessions" table (created by migration 002). Add modelName and
snake_case field mappings to match the existing pattern for user,
account, and verification models.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-31 02:13:16 +00:00
+9
View File
@@ -36,6 +36,15 @@ export const auth = betterAuth({
},
session: {
modelName: "sessions",
fields: {
userId: "user_id",
expiresAt: "expires_at",
ipAddress: "ip_address",
userAgent: "user_agent",
createdAt: "created_at",
updatedAt: "updated_at",
},
expiresIn: 60 * 60 * 24 * 7, // 7 days
updateAge: 60 * 60 * 24, // refresh after 1 day
cookieCache: {