disallow underscores for names
This commit is contained in:
@@ -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..."
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user