Repository navigation
Commit 35a8f08
fix(console): hide the dev admin chip when email and password sign-in is off (#30531)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuSsxASUNa88cQKqk6NNZWir)_
Fixes #30420
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Console 登录页在服务端关闭邮箱+密码登录时,不再显示「Sign in as dev admin」开发管理员入口。
- 为什么改:该入口用邮箱+密码登录,密码登录关闭时服务端必然拒绝(`EMAIL_PASSWORD_DISABLED`),页面其余部分已只显示
Google 等提供方,入口是误导。
- 风险与回滚:仅 `os dev` 开发环境可见的一行渲染条件,生产从不下发 `devSeedAdmin`;回滚即 revert 本 PR。
- 先看:`ui/apps/console/src/pages/auth/LoginPage.tsx` 中 `DevAdminRow`
的渲染条件;其次测试文件新增两例。
- 两分钟验证:`pnpm --dir ui exec vitest run
apps/console/src/pages/auth/__tests__/LoginPage.dev-admin-hint.test.tsx`,预期
12 passed。
- 需要你做的:无,席位落地。
## What changes
- `LoginPage` drew the dev-seeded admin row on `devSeedAdmin` alone. It
now draws it only when `/api/v1/auth/config` does not report
`emailPassword.enabled: false`, the same answer `LoginForm` reads to
hide the password form (`config?.emailPassword?.enabled === false`). The
condition reads the `authConfig` state the "Read public auth config"
effect already stores; that effect and the "Post-login orchestration"
effect are unchanged.
- Changeset: `.changeset/30420-dev-admin-chip-password-off.md`,
`@object-ui/console` patch.
## Tests
`ui/apps/console/src/pages/auth/__tests__/LoginPage.dev-admin-hint.test.tsx`,
two new cases:
- seed + `emailPassword.enabled: false` (Google configured) → no
`dev-admin-hint` row, no chip, read after the Google button appears;
- seed + `emailPassword.enabled: true` → row and chip (positive control;
the existing seed-only case covers the absent key).
<details><summary>Readings</summary>
- Target file at `e8c3c5f4`: Test Files 1 passed (1), Tests 12 passed
(12), lock VERDICT command-exit 0.
- Whole `apps/console/src/pages/auth/` at the merged head `f302e1af`:
Test Files 28 passed (28), Tests 230 passed (230), lock VERDICT
command-exit 0.
- Ablation (fix committed first; `scripts/ablation-replace.mjs`, anchor
`devSeedAdmin && authConfig?.emailPassword?.enabled !== false ? (`
replaced by `devSeedAdmin ? (`, anchor x1 → x0, blob 3d2fbca →
fa92222ba639): `× renders no row when the server turned email and
password sign-in off`, Tests 1 failed / 11 passed. Restored: blob ==
HEAD (3d2fbca), `git diff HEAD` empty.
- `pnpm --filter @object-ui/console run type-check`: exit 0. ESLint on
both touched files: exit 0.
</details>
## Acceptance notes
- The whole row (label and chip) is hidden, not only the chip: the row
exists to offer the seeded password account, which cannot sign in while
password sign-in is off.
## Verification
<details><summary>Gates</summary>
- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran FILE`: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN, all with
recorded exit codes, every one exit 0 (run at `e8c3c5f4`; the merge of
`origin/main` into `f302e1af` brought no change to the three changed
paths, and the derivation at `f302e1af` names the same 34).
- Also run, exit 0: `pnpm --dir ui run check:spec-symbols`, `node
scripts/check-sdui-manifest.mjs`, `pnpm check:changeset-fixed`, `pnpm
--dir ui exec vitest run scripts/` (Test Files 170 passed / 2 skipped).
- CI families: read from this PR's check-runs.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgVfPeFZkN1FP93imKU)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgVfPeFZkN1FP93imKU
Co-authored-by: Claude <noreply@anthropic.com>1 parent 58085ff commit 35a8f08
3 files changed
Lines changed: 40 additions & 2 deletions
File tree
- .changeset
- ui/apps/console/src/pages/auth
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
152 | 175 | | |
153 | 176 | | |
154 | 177 | | |
| |||
0 commit comments