diff --git a/lib/routes/api/users.js b/lib/routes/api/users.js index 9a59250..901630c 100644 --- a/lib/routes/api/users.js +++ b/lib/routes/api/users.js @@ -370,7 +370,7 @@ router.post('/', async(req, res) => { const email = allUsers.find((e) => e.email === payload.email); if (email) { logger.debug({payload}, 'user with this email already exists'); - return res.sendStatus(403); + res.status(422).json({msg: 'user with this email already exists'}); } if (decodedJwt.scope === 'admin') {