Guest User

Untitled

a guest
Jun 24th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. app.post("/login", function(req, res) {
  2. db.collection('signup').findOne({ $and: [ { username: req.body.loginUsername }, { password: req.body.loginPassword} ] }, function(err,user){
  3.  
  4. if(err){
  5. console.log(err);
  6. return res.status(500).send();
  7. }
  8. if(!user){
  9. res.send("Username or Password did not match");
  10. }
  11.  
  12. app.get("/profile", function(req,res){
  13.  
  14. res.render("pages/profile.ejs", { username: req.body.loginUsername })
  15.  
  16.  
  17.  
  18.  
  19. });
  20.  
  21. });
  22. });
Add Comment
Please, Sign In to add comment