Skip to content
Snippets Groups Projects
Commit 36051684 authored by ric's avatar ric
Browse files

update

parent d2fab017
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ router.post('/signup', (req, res)=>{
if(err){ console.log("Error with the database");};
if(result!=null){
res.send('Username already used');
return res.status(422).send('Invalid username')
}
else{
const user = new userFromDb({username:username, password:password});
......@@ -35,7 +35,7 @@ router.post('/signin', (req, res)=>{
if(err){ console.log("Error with the database");};
if(result==null){
res.send('Invalid username or password');
return res.status(422).send('Invalid username or password');
}
else{
result.comparePassword(password, function(err, isMatch) {
......@@ -44,7 +44,7 @@ router.post('/signin', (req, res)=>{
if (isMatch){
res.send('Login successful');
}else{
alert("Invalid username e/o password");
return res.status(422).send('Invalid username or password');
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment