mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-24 13:02:16 +00:00
error case: creating user with duplicate email, return json with msg for toast
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user