diff options
author | Mateja <mail@matejamaric.com> | 2021-07-24 23:34:36 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2021-07-24 23:34:36 +0200 |
commit | 54e471b5741a7569001067e476467c4ff6f6a7de (patch) | |
tree | d248e2bcf93f85b76bb7801df3c5173a28c7ad2d /server/controllers | |
parent | 1b020a3f50b8317b46d336569fb8b8290855dcff (diff) | |
download | mevn-ecommerce-54e471b5741a7569001067e476467c4ff6f6a7de.tar.gz mevn-ecommerce-54e471b5741a7569001067e476467c4ff6f6a7de.zip |
Return status 400 when failing to register user.
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/user.js | 2 |
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 })); |