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: Stockboy Steve <steve@cartsnitch.com> Co-authored-by: Paperclip <noreply@paperclip.ing> Co-authored-by: cartsnitch-ceo[bot] <269712056+cartsnitch-ceo[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
201606bef8
commit
be78b36702
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user