diff --git a/packages/api/src/routers/auth/auth_router.ts b/packages/api/src/routers/auth/auth_router.ts index 5a48e9634..01be9c019 100644 --- a/packages/api/src/routers/auth/auth_router.ts +++ b/packages/api/src/routers/auth/auth_router.ts @@ -500,6 +500,17 @@ export function authRouter() { ) } const { email, password, name, username, bio, pictureUrl } = req.body + + function isURLPresent(input: string): boolean { + const urlRegex = /(https?:\/\/[^\s]+)/g + return urlRegex.test(input) + } + + if (isURLPresent(email) || isURLPresent(name) || isURLPresent(username)) { + res.redirect(`${env.client.url}/auth/email-signup?errorCodes=UNKNOWN`) + return + } + // trim whitespace in email address const trimmedEmail = email.trim() try {