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
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m17s
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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' });
|
||||
}
|
||||
|
||||
@@ -205,6 +205,7 @@ export default function Dashboard() {
|
||||
className="input-field"
|
||||
placeholder={t('dashboard.roomNamePlaceholder')}
|
||||
required
|
||||
minLength={2}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -502,6 +502,7 @@ export default function RoomDetail() {
|
||||
onChange={e => setEditRoom({ ...editRoom, name: e.target.value })}
|
||||
className="input-field"
|
||||
required
|
||||
minLength={2}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user