Advertisement
Guest User

user pass api

a guest
Feb 11th, 2016
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. router.get('/auth/:user/:pass', function(req, res, next) {
  2. mongo.findDocuments('Users', {"username" : req.params.user}, function(docs) {
  3. var user = docs[0];
  4. if(!user) {
  5. console.log('username does not exsist');
  6. return;
  7. } else {
  8. if(!user.password == req.params.pass) {
  9. console.log('password is incorrect');
  10. return;
  11. } else {
  12. console.log('successfull combo')
  13. }
  14. }
  15. });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement