When creating a new user, i get an Error saying that data and salt are missing arguments that i passed previously when creating the new user, i also had to create that if statement in order to not get another error saying that User.email was undefined
It is difficult to know what was happening without knowing the exact error log.
The encircled if-statement seems weird. I am not an expert in MongoDB but I think it is basically checking that the User model has an email property, if it doesn’t it responds with “User already registered”.
You should probably make sure that you User model indeed has an “email” property.
I found out i was missing body parser in my app, it works properly know, but thanks for the tip anyway!