diff --git a/API/Auth/auth.js b/API/Auth/auth.js index e426b7a..80b8534 100644 --- a/API/Auth/auth.js +++ b/API/Auth/auth.js @@ -39,7 +39,7 @@ exports.register = async (req, res, next) => { } catch(error) { res.status(400).json({ message: "User not successful created", - error: error.message, + error: error.message.includes("E11000") ? "as there is an account already with this name": error.message, }); } };