diff --git a/backend/app/schemas/auth.py b/backend/app/schemas/auth.py index 79dfc15..bd77b97 100644 --- a/backend/app/schemas/auth.py +++ b/backend/app/schemas/auth.py @@ -180,6 +180,8 @@ class ProfileUpdate(BaseModel): if v is None: return v import re + if ' ' in v: + raise ValueError('Umbral name must be a single word with no spaces') if not re.match(r'^[a-zA-Z0-9_-]{3,50}$', v): raise ValueError('Umbral name must be 3-50 alphanumeric characters, hyphens, or underscores') return v diff --git a/frontend/src/components/settings/SettingsPage.tsx b/frontend/src/components/settings/SettingsPage.tsx index 607de0b..dda8c69 100644 --- a/frontend/src/components/settings/SettingsPage.tsx +++ b/frontend/src/components/settings/SettingsPage.tsx @@ -227,6 +227,10 @@ export default function SettingsPage() { // Client-side umbral name validation if (field === 'umbral_name') { + if (current.includes(' ')) { + setUmbralNameError('Must be a single word with no spaces'); + return; + } if (!current || !/^[a-zA-Z0-9_-]{3,50}$/.test(current)) { setUmbralNameError('3-50 characters: letters, numbers, hyphens, underscores'); return;