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>
<input
type="text"
pattern="[A-Za-z0-9_]+"
title="Alphanumeric characters and underscores only"
pattern="[A-Za-z0-9]+"
title="Alphanumeric characters only"
id="guestName"
name="guestName"
placeholder="Enter name here..."

View File

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