Commit e5fd28c
convertWhere() read field/operator/value and never `mode`, so a SCIM
`userName eq "Alice@example.com"` lookup (mode: 'insensitive', because
RFC 7643 marks userName caseExact:false) was answered case-sensitively —
matching or not depending on the driver, and provisioning a duplicate user
rather than raising, because SCIM's path is "look up, create if absent".
Both halves of the maintainer's option-3 ruling:
- NORMALISED_IDENTIFIER_FIELDS declares the identifier set ({ user: ['email'] },
the field @better-auth/scim actually maps userName onto) and drives the read
and write halves from one place, so a field cannot join one of them only.
Stored lower-cased, compared lower-cased — no new query vocabulary.
- convertWhere() handles `mode` explicitly: satisfied by construction on a
normalised identifier, and a loud warning naming model, field and operator on
any other field, instead of silently answering case-sensitively.
`sensitive` / absent-mode clauses keep their comparand byte-for-byte.
No migration: every existing producer already lower-cased user.email.
Claude-Session: https://claude.ai/code/session_01BM1tNf5U3nEbHKR4fo5qVQ
Co-authored-by: Claude <noreply@anthropic.com>
1 parent c5eef1d commit e5fd28c
3 files changed
Lines changed: 760 additions & 36 deletions
File tree
- .changeset
- packages/plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments