Commit cf381a7
fix(auth): sso() takes no schema option; bridge ssoProvider via adapter map
@better-auth/sso (1.6.20) exposes NO `schema` option (verified: no mergeSchema,
runtime never reads options.schema), so the per-plugin schema-remap that
oauthProvider uses is unavailable. Drop the invalid `schema` arg + the dead
buildSsoPluginSchema(); call sso() bare (gated off by OS_SSO_ENABLED). Add
ssoProvider -> sys_sso_provider to AUTH_MODEL_TO_PROTOCOL.
KNOWN-INCOMPLETE (documented inline): the ACTIVE factory adapter
(createObjectQLAdapterFactory) passes the raw better-auth model name to the
data engine and maps fields only from per-model declarations — neither of
which the sso plugin provides. Finishing the integration needs objectql-adapter
to resolve schema-less plugin model + camelCase field names, then full E2E.
Compiles green (DTS ok for plugin-auth + platform-objects); feature off by
default.
+ pnpm-lock.yaml (@better-auth/sso ^1.6.20).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 367bbf4 commit cf381a7
4 files changed
Lines changed: 183 additions & 19 deletions
File tree
- packages/plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
939 | 938 | | |
940 | 939 | | |
941 | 940 | | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
949 | 950 | | |
950 | 951 | | |
951 | 952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
696 | 690 | | |
697 | 691 | | |
698 | 692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| |||
0 commit comments