Any email is allowed to sign up. Only valid email addresses should be allowed to sign up for.
How to reproduce
Send following request in auth/signup route
{
"userData" : {
"userId" : 2,
"password" : "alice",
"email" : "invalidiemailaddress",
"firstName" : "alice",
"lastName" : "green",
"is_verified" : false,
"created_at" : 1585926378
}
}
This will result in successful user creation.
Possible solution :
Once email is destructured for the first time, use some kind of validation there before directly feeding it to model function createUser.
Any email is allowed to sign up. Only valid email addresses should be allowed to sign up for.
How to reproduce
Send following request in
auth/signuproute{ "userData" : { "userId" : 2, "password" : "alice", "email" : "invalidiemailaddress", "firstName" : "alice", "lastName" : "green", "is_verified" : false, "created_at" : 1585926378 } }This will result in successful user creation.
Possible solution :
Once email is destructured for the first time, use some kind of validation there before directly feeding it to model function
createUser.