aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-24 23:34:36 +0200
committerMateja <mail@matejamaric.com>2021-07-24 23:34:36 +0200
commit54e471b5741a7569001067e476467c4ff6f6a7de (patch)
treed248e2bcf93f85b76bb7801df3c5173a28c7ad2d /server
parent1b020a3f50b8317b46d336569fb8b8290855dcff (diff)
downloadmevn-ecommerce-54e471b5741a7569001067e476467c4ff6f6a7de.tar.gz
mevn-ecommerce-54e471b5741a7569001067e476467c4ff6f6a7de.zip
Return status 400 when failing to register user.
Diffstat (limited to 'server')
-rw-r--r--server/controllers/user.js2
1 files changed, 1 insertions, 1 deletions
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
}));