You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/AUTHENTICATION_STANDARD.md
+82Lines changed: 82 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -416,6 +416,88 @@ hooks: {
416
416
}
417
417
```
418
418
419
+
### Database Field Mapping
420
+
421
+
The `mapping` configuration allows you to map ObjectStack standard field names (which follow Auth.js conventions) to driver-specific field names. This is particularly useful for ensuring compatibility with authentication libraries like `better-auth` that use different column naming conventions.
422
+
423
+
```typescript
424
+
mapping: {
425
+
// User model field mapping (optional)
426
+
user?: {
427
+
emailVerified: 'email_verified', // Map to snake_case
428
+
createdAt: 'created_at',
429
+
updatedAt: 'updated_at',
430
+
},
431
+
432
+
// Session model field mapping (default better-auth compatible)
0 commit comments