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
fix(import): sanitize row errors — never leak raw SQL, friendly constraint messages (#3566) (#3572)
Import rows that hit a DB constraint surfaced the driver's raw error verbatim —
including the full failing SQL statement (e.g. `insert into sys_user (...) - UNIQUE
constraint failed: sys_user.phone_number`), which is unreadable and leaks the schema.
- sanitizeRowError() maps SQLite/MySQL/Postgres UNIQUE and NOT NULL failures to
human wording and, as a backstop, never lets a raw SQL statement reach the client.
Already-friendly messages (better-auth's "User already exists") pass through.
- isLikelyEmail rejects non-ASCII, so `x@柴仟.com` fails the import dry-run instead
of only at real-import time inside better-auth.
- Unit tests for both.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments