diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-15 02:16:39 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-15 02:21:01 +0200 |
| commit | bdefcd025604f2c3009fe5e0cc01213c2ba62a6a (patch) | |
| tree | eebd34aa234a9148045ca25b00bf7c8039e00ccf /packages/meshbay-hub/src/meshbay_hub/static/auth-page.js | |
| parent | 027e7d55f3bb57ba5150fd77e8f0114a0baf8d5c (diff) | |
| download | meshbay-bdefcd025604f2c3009fe5e0cc01213c2ba62a6a.tar.gz | |
feat(hub): usernames are at least 8 characters at registration
Existing shorter accounts keep signing in. Test usernames padded to match.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XuNrwLf5EFWCMHzfoEvnpm
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/auth-page.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/auth-page.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/auth-page.js b/packages/meshbay-hub/src/meshbay_hub/static/auth-page.js index d4dc5a4..04a00af 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/auth-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/auth-page.js @@ -10,6 +10,9 @@ import { Icon } from './icon.js'; const PASSWORD_MIN_BITS = 60; const PASSWORD_MIN_LEN = 12; +// The hub's USERNAME_MIN_LEN (api/users.py), checked here so the refusal comes +// before a passphrase derivation rather than after it. +const USERNAME_MIN_LEN = 8; // ── reCAPTCHA v2 helper ────────────────────────────────────────────────────── @@ -284,6 +287,9 @@ export function RegisterPage() { const onSubmit = async (e) => { e.preventDefault(); const name = username.trim(); + if (name.length < USERNAME_MIN_LEN) { + setError(t('register.err_username_len', { n: USERNAME_MIN_LEN })); return; + } if (password !== confirm) { setError(t('register.err_mismatch')); return; } if (password.length < PASSWORD_MIN_LEN) { setError(t('register.err_min_len', { n: PASSWORD_MIN_LEN })); return; |