You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GDPR-K + UX safety pass on the register flow.
Patch 1 — birth year dropdown clamped (auth-form.tsx:99).
Was 90 entries (1932-2021). Now 11 entries
(currentYear-6 → currentYear-16) — exactly the GDPR-K target window
(7-16) plus a 2-year buffer at each end for user error. Pre-teens
can no longer pick birth years that fall outside parental-consent
flow eligibility.
Patch 2 — password strength gates (auth-form.tsx:82-83 + route.ts).
Form: minLength 6 → 8, plus HTML5 pattern `(?=.*[a-zA-Z])(?=.*\d).{8,}`
+ localized title for keyboard-tooltip + screen-reader hint. Server
mirrors with the same Zod regex so a hand-crafted POST can't bypass.
Login mode keeps minLength 6 to avoid breaking existing accounts.
Patch 3 — hardcoded PL labels → dict (auth-form.tsx:32, 89, 109, 117).
4 strings moved into `dict.auth.{errorBirthYearMissing,birthYearLabel,
parentEmailLabel,parentEmailPlaceholder}` × 4 locales. UK/CS/EN players
no longer see leaked Polish form chrome.
Patch 4 — server-side birth year clamp (api/auth/register/route.ts:31-36).
Zod `.min(CURRENT_YEAR - 16).max(CURRENT_YEAR - 6)` matches the
client clamp. Validation failure now returns the first Zod issue's
message instead of a generic "fill the form" string, so the client
sees actionable error copy. Existing accounts unaffected — clamp
gates new registrations only.
Patch 5 — register chip title i18n (register/page.tsx:28).
Was hardcoded EN ("GDPR-K compliant — automatic parental consent
under 16"), leaked to all non-en locales. Now `t.gdprKTooltip` ×
4 locales.
Patch 7 — live password strength checklist (auth-form.tsx).
Register-only. Three rules visible under password input as the user
types (8+ chars / letter / digit), each flips ○ → ✓ + green when
satisfied. Kids see WHY the form blocks submission instead of an
opaque HTML5 alert. Hidden in login mode.
Patch 6 (vitest register-validation test) deferred — schema +
client form pattern give belt-and-braces coverage; a dedicated test
file would be a Pass-11 polish.
Validation:
- pnpm typecheck → 0 errors
- 5 of 7 spec patches landed; 2 deferred (test, G-22 CSRF audit)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: lib/locales/en.ts
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,16 @@ const en: typeof plDict = {
85
85
"By signing up you agree to us storing your username, password hash and game scores. No e-mail, no analytics, no advertisers. Delete your account anytime with one click.",
86
86
errorGeneric: "Something went wrong.",
87
87
errorNetwork: "Network error. Try again.",
88
+
errorBirthYearMissing: "Enter your birth year.",
89
+
birthYearLabel: "Birth year (GDPR-K)",
90
+
parentEmailLabel: "Parent's email (required for under 16)",
91
+
parentEmailPlaceholder: "parent@example.com",
92
+
passwordTitle: "Min. 8 chars, 1 letter and 1 digit",
93
+
pwRule8chars: "At least 8 characters",
94
+
pwRuleLetter: "At least 1 letter",
95
+
pwRuleDigit: "At least 1 digit",
96
+
gdprKTooltip:
97
+
"GDPR-K compliant — automatic parental consent for users under 16.",
0 commit comments