Repository navigation
Commit ff91895
fix(auth,console): register mismatch is a confirm-field error; /register links privacy and terms (#26291)
Fixes #25885
Clause-②: no
Metadata-protocol: none
## What changes
- **Password mismatch is a confirm-field error**
(`ui/packages/auth/src/RegisterForm.tsx`). The form used to show
"Passwords do not match" as the `AuthErrorBanner` at the top of the
form, above the name field. It now shows it under the confirm-password
input. The input carries `aria-invalid="true"` and
`aria-describedby="register-confirm-password-error"`, and the message
line has `role="alert"`. Editing either password clears the error. The
top banner still shows the server's refusals (existing account, closed
registration). The wording is the existing
`labels.passwordMismatchError`, so no locale key changes. Every page
that renders `RegisterForm` gets this, including app-shell's
`DefaultRegisterPage`.
- **`/register` links privacy and terms**
(`ui/apps/console/src/pages/auth/RegisterPage.tsx`). The register page
now draws the same footer as `/login`: the locale switch, plus the
Privacy and Terms links that `GET /api/v1/auth/config` serves as
`features.privacyUrl` / `features.termsUrl`. A link appears only when
its URL is served and is an http(s) URL or a same-origin path.
- **One reader, not a copy**
(`ui/apps/console/src/pages/auth/AuthFooter.tsx`, new). `legalHref`,
`readLegalLinks` and the footer component (`LoginFooter`, renamed
`AuthFooter`) moved out of `LoginPage.tsx` unchanged. `LoginPage`
imports them, and its rendered output is the same:
`data-testid="auth-footer"`, classes and link attributes are
byte-identical. The login pins in `LoginPage.layout-12600.test.tsx` pass
unchanged.
## Tests (head `2d8ec77c`)
New pins, written red-first:
-
`ui/packages/auth/src/__tests__/registerMismatchFieldError-25885.test.tsx`
(3 tests): a mismatch sets `aria-invalid` and `aria-describedby` on the
confirm input, and the referenced element reads the message. The message
comes after the input, no other alert is shown, and sign-up is not sent.
Editing the confirmation clears the error. A matching pair stays
unmarked, and a server refusal still goes to the banner.
-
`ui/apps/console/src/pages/auth/__tests__/RegisterPage.legalLinks-25885.test.tsx`
(3 tests): Privacy and Terms appear inside `auth-footer` with the served
hrefs and `rel=noopener`. No link appears when no URL is served. No link
appears for `javascript:` or protocol-relative URLs.
Red-first, on the pre-fix tree under the lock: the RegisterForm pin
failed 2 of 3 (the preservation test passed, as intended). The
RegisterPage pin could not resolve `@objectstack/spec` before the build,
so it was NOT MEASURED there. The ablations below are its red.
Ablation, one landed mutation per tested behaviour, via
`scripts/ablation-replace.mjs` under the lock (anchor 1 → 0, blob moved,
restored to the HEAD blob, `git diff HEAD` empty):
- RegisterPage without the footer line: `RegisterPage.legalLinks-25885`,
**1 failed | 2 passed** (both absence tests stay green by design).
- RegisterForm with `setConfirmError` reverted to `setError` (back to
the banner): `registerMismatchFieldError-25885`, **2 failed | 1
passed**.
Green, under `scripts/pm/os-verify-lock.sh` (VERDICT command-exit 0),
cwd `ui/`:
- `pnpm exec vitest run packages/auth/ apps/console/src/pages/auth/
--maxWorkers=2`: **Test Files 55 passed (55) · Tests 441 passed (441)**.
This includes every login-page pin.
- `pnpm --filter @object-ui/auth type-check` (`tsc --noEmit && tsc -p
tsconfig.test.json`): exit 0.
- `@object-ui/console` `tsc --noEmit`: **NOT MEASURED**. Locally the
`@object-ui/*` closure was not built, so all 862 diagnostics were
module-resolution errors (TS2307/TS2882/TS7006 fallout). CI's `Type
Check UI` measures it.
## Gates (head `2d8ec77c`)
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 35 commands. 34 exited 0, and
`--ran` reconciles: "35 derived famil(ies) accounted for — 34 run, 1
NOT-MEASURED". The NOT-MEASURED one is `pnpm check:type-check-debt`,
which exited 3 (PREREQUISITE NOT MET). Its `--re-measure` builds every
package under the shared lock and never got a turn. This diff touches no
tsconfig, typecheck script or ledger. CI's `Lint & Repo Gates` runs it.
`node scripts/check-sdui-manifest.mjs`: exit 0. `@object-ui/auth` and
`@object-ui/console` have no `scripts/sdui-manifest.sources/*.json`
record, so nothing was re-recorded.
## Acceptance notes
- **The console's `/register` gets the whole login footer, so it also
gains the locale switch.** That is the "same footer" reading of the
card. Narrowing it to the two links would need a prop on the shared
footer.
- **No consent sentence yet.** The card's "ideally" form ("By creating
an account you agree to the Terms and Privacy Policy" under the button)
is not done. That sentence would be new visible wording, and this claim
keeps the locale packs out of scope. The footer reuses the existing
`auth.login.footer.privacy` / `.terms` keys, so it is translated today.
- **app-shell's default pages draw no legal links.**
`DefaultRegisterPage` and `DefaultLoginPage` in
`ui/packages/app-shell/src/console/auth/` show none on either page, so
they agree with each other. They are not part of this claim.
- **Only the mismatch moved.** "Password must be at least 8 characters"
stays in the banner. Both inputs carry `minLength={8}`, so the browser's
own validation usually stops it first.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 817cb89 commit ff91895
7 files changed
Lines changed: 301 additions & 70 deletions
File tree
- .changeset
- ui
- apps/console/src/pages/auth
- __tests__
- packages/auth/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 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 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 83 | | |
110 | 84 | | |
111 | 85 | | |
| |||
381 | 355 | | |
382 | 356 | | |
383 | 357 | | |
384 | | - | |
| 358 | + | |
385 | 359 | | |
386 | 360 | | |
387 | 361 | | |
| |||
467 | 441 | | |
468 | 442 | | |
469 | 443 | | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | 444 | | |
509 | 445 | | |
510 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| 222 | + | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
| |||
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
| 326 | + | |
321 | 327 | | |
322 | 328 | | |
323 | 329 | | |
| |||
| 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 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| |||
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
| 176 | + | |
170 | 177 | | |
171 | 178 | | |
172 | | - | |
| 179 | + | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
| |||
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
266 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
| |||
281 | 291 | | |
282 | 292 | | |
283 | 293 | | |
284 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
285 | 298 | | |
286 | 299 | | |
287 | 300 | | |
288 | 301 | | |
289 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
290 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
291 | 315 | | |
292 | 316 | | |
293 | 317 | | |
| |||
0 commit comments