feat(room): enforce minimum room name length of 2 characters in creation and editing
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m17s

This commit is contained in:
2026-03-03 10:02:28 +01:00
parent 1c9c5224ae
commit 4bb22be496
4 changed files with 9 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ export async function createMeeting(room, logoutURL, loginURL = null, presentati
const params = {
meetingID: room.uid,
name: room.name,
name: room.name.length >= 2 ? room.name : room.name.padEnd(2, ' '),
attendeePW,
moderatorPW,
welcome,

View File

@@ -166,6 +166,9 @@ router.post('/', authenticateToken, async (req, res) => {
if (!name || name.trim().length === 0) {
return res.status(400).json({ error: 'Room name is required' });
}
if (name.trim().length < 2) {
return res.status(400).json({ error: 'Room name must be at least 2 characters' });
}
// M7: field length limits
if (name.trim().length > 100) {
@@ -243,6 +246,9 @@ router.put('/:uid', authenticateToken, async (req, res) => {
} = req.body;
// M12: field length limits (same as create)
if (name && name.trim().length < 2) {
return res.status(400).json({ error: 'Room name must be at least 2 characters' });
}
if (name && name.trim().length > 100) {
return res.status(400).json({ error: 'Room name must not exceed 100 characters' });
}

View File

@@ -205,6 +205,7 @@ export default function Dashboard() {
className="input-field"
placeholder={t('dashboard.roomNamePlaceholder')}
required
minLength={2}
/>
</div>

View File

@@ -502,6 +502,7 @@ export default function RoomDetail() {
onChange={e => setEditRoom({ ...editRoom, name: e.target.value })}
className="input-field"
required
minLength={2}
/>
</div>