diff options
| -rw-r--r-- | routes/users.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/routes/users.ts b/routes/users.ts index 9b0fd240..f4d079e8 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -568,13 +568,11 @@ export default { }, async request(req, res) { - const { - body: { id, email }, - } = req; - try { - const user = await g(`user:${id}`); + const { email } = req.body; + const { user } = req; + const { id } = user; - if (!user) fail("user not found"); + try { if (await g(`email:${email.toLowerCase()}`)) fail("Email already in use"); const { username } = user; |
