Commit b4502e0
feat(auth): surface features.sso in public /auth/config
getPublicConfig() advertised every other auth capability flag (oidcProvider,
twoFactor, multiOrgEnabled, …) but omitted enterprise SSO, even though the
manager already computes whether @better-auth/sso is wired (OS_SSO_ENABLED /
plugins.sso). The login UI therefore had nothing to gate on and rendered the
"Sign in with SSO" button unconditionally; on a deployment without SSO wired,
clicking it only then surfaced "No SSO provider is configured for this email
domain."
features.sso is now resolved with the EXACT logic that decides whether the
plugin is mounted in buildPlugins(), so the advertised capability can never
disagree with the actual /sign-in/sso route. Tests cover default-off, config-on,
and OS_SSO_ENABLED env override.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 8bb026b commit b4502e0
3 files changed
Lines changed: 70 additions & 0 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
| 1049 | + | |
1049 | 1050 | | |
1050 | 1051 | | |
1051 | 1052 | | |
| |||
1054 | 1055 | | |
1055 | 1056 | | |
1056 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1057 | 1100 | | |
1058 | 1101 | | |
1059 | 1102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
1465 | 1473 | | |
1466 | 1474 | | |
1467 | 1475 | | |
| |||
1471 | 1479 | | |
1472 | 1480 | | |
1473 | 1481 | | |
| 1482 | + | |
1474 | 1483 | | |
1475 | 1484 | | |
1476 | 1485 | | |
| |||
0 commit comments