From 54e471b5741a7569001067e476467c4ff6f6a7de Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 24 Jul 2021 23:34:36 +0200 Subject: Return status 400 when failing to register user. --- server/controllers/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server') diff --git a/server/controllers/user.js b/server/controllers/user.js index 141d194..7a2b78a 100644 --- a/server/controllers/user.js +++ b/server/controllers/user.js @@ -22,7 +22,7 @@ module.exports = { status: "User successfully registered!", token: jwt.sign({sub: user._id}, masterKey, {expiresIn: "1d"}) })) - .catch(err => res.json({ + .catch(err => res.status(400).json({ status: "Error when registering user!", error: err })); -- cgit v1.2.3