feat(auth): enforce length limits for name and password during registration

feat(comments): add content length validation for comments and annotations

feat(guest-gate): restrict guest name length and update localStorage handling

feat(share-link-unlock): set maxLength for password input field
This commit is contained in:
Yusuf İpek
2026-04-10 20:28:55 +03:00
parent d1ffc4c4db
commit 03bfd565e8
4 changed files with 21 additions and 7 deletions
+5 -3
View File
@@ -26,8 +26,9 @@ export function GuestGate({ children }: { children: ReactNode }) {
}
const confirm = () => {
if (!guestName.trim()) return;
localStorage.setItem('openframe_guest_name', guestName.trim());
const trimmed = guestName.trim();
if (!trimmed || trimmed.length > 100) return;
localStorage.setItem('openframe_guest_name', trimmed);
setConfirmed(true);
};
@@ -47,13 +48,14 @@ export function GuestGate({ children }: { children: ReactNode }) {
<Input
placeholder="Your name"
value={guestName}
maxLength={100}
onChange={(e) => setGuestName(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter') confirm();
}}
autoFocus
/>
<Button className="w-full" disabled={!guestName.trim()} onClick={confirm}>
<Button className="w-full" disabled={!guestName.trim() || guestName.trim().length > 100} onClick={confirm}>
Continue
</Button>
</div>
+1
View File
@@ -61,6 +61,7 @@ export function ShareLinkUnlock({ videoId }: ShareLinkUnlockProps) {
type="password"
placeholder="Password"
value={password}
maxLength={128}
onChange={(event) => setPassword(event.target.value)}
onKeyDown={(event) => {
if (event.key === 'Enter') {