disallow underscores for names

This commit is contained in:
Nathaniel Tampus
2023-03-19 21:24:41 +08:00
parent 9ae628c592
commit dc2f218115
2 changed files with 3 additions and 3 deletions

View File

@@ -62,8 +62,8 @@ export default function AuthModal() {
<span>Name</span> <span>Name</span>
<input <input
type="text" type="text"
pattern="[A-Za-z0-9_]+" pattern="[A-Za-z0-9]+"
title="Alphanumeric characters and underscores only" title="Alphanumeric characters only"
id="guestName" id="guestName"
name="guestName" name="guestName"
placeholder="Enter name here..." placeholder="Enter name here..."

View File

@@ -22,7 +22,7 @@ export const guestSession = async (req: Request, res: Response) => {
try { try {
const name = xss(req.body.name); const name = xss(req.body.name);
const pattern = /^[A-Za-z0-9_]+$/; const pattern = /^[A-Za-z0-9]+$/;
if (!pattern.test(name)) { if (!pattern.test(name)) {
res.status(400).end(); res.status(400).end();