mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add url present check on email sign up
This commit is contained in:
parent
ede99dcd33
commit
200354d181
1 changed files with 11 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue