summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-04-09 14:46:47 -0400
committergumi <git@gumi.ca>2018-04-09 14:46:47 -0400
commita63b967229f374660ca5db4b3088cd118b0d9073 (patch)
tree6b5b61765d0261a125043fee71f869cc81ea3a55
parent662044418fcda97669c9401c6e6a7275e7e71b93 (diff)
downloadapi-a63b967229f374660ca5db4b3088cd118b0d9073.tar.gz
api-a63b967229f374660ca5db4b3088cd118b0d9073.tar.bz2
api-a63b967229f374660ca5db4b3088cd118b0d9073.tar.xz
api-a63b967229f374660ca5db4b3088cd118b0d9073.zip
fix the email regex
-rw-r--r--server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.js b/server.js
index 6fe33ef..80dfabc 100644
--- a/server.js
+++ b/server.js
@@ -112,7 +112,7 @@ api.post("/api/account", (req, res) => {
!Reflect.has(req.body, "password") || !Reflect.has(req.body, "email") ||
!req.body.username.match(/^[a-zA-Z0-9]{4,23}$/) ||
!req.body.password.match(/^[a-zA-Z0-9]{4,23}$/) ||
- !req.body.email.match(/^|(?:[a-zA-Z0-9.$&+=_~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/) ||
+ !req.body.email.match(/^$|^(?:[a-zA-Z0-9.$&+=_~-]{1,34}@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,35}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?){0,9})$/) ||
req.body.email.length >= 40)
{
res.status(400).json({