Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function PasswordChecker(accounts) {
  2.     return function (user, password) {
  3.         var passwordHash = Q.get(accounts, user);
  4.         return when(passwordHash, function (passwordHash) {
  5.             if (hash(password) === passwordHash)
  6.                 return true;
  7.         };
  8.     };
  9. }
  10.  
  11. // returns a password checking capability
  12. // but does not return access to the passwordHash
  13. return PasswordChecker(accounts);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement