Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // routes/auth.js
  2.  
  3. var passport = require('passport')
  4. , LocalStrategy = require('passport-local').Strategy;
  5.  
  6.  
  7. exports.member_auth = function(req, res) {
  8. // console.log("Request Body == ", req.body);
  9. var strategy = new LocalStrategy({
  10. usernameField: 'email',
  11. passwordField: 'password'
  12. },
  13. function(username, password, done) {
  14. console.log("username: " + username);
  15. console.log("password: " + password);
  16. return done(null, false);
  17. // when this route is hit, it just hangs, despite returning done(null, false)
  18. });
  19.  
  20. passport.use(strategy, function(username, password, done){
  21. // silence is golden
  22. });
  23.  
  24. passport.authenticate('local');
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement