-
-
Save jescalan/5851449 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// routes/auth.js | |
var passport = require('passport') | |
, LocalStrategy = require('passport-local').Strategy; | |
exports.member_auth = function(req, res) { | |
// console.log("Request Body == ", req.body); | |
var strategy = new LocalStrategy({ | |
usernameField: 'email', | |
passwordField: 'password' | |
}, | |
function(username, password, done) { | |
console.log("username: " + username); | |
console.log("password: " + password); | |
return done(null, false); | |
// when this route is hit, it just hangs, despite returning done(null, false) | |
}); | |
passport.use(strategy, function(username, password, done){ | |
// silence is golden | |
}); | |
passport.authenticate('local'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// routes/index.js | |
var auth = require('./auth'); | |
exports.set = function(app, express) { | |
app.post('/login', auth.member_auth); | |
// when this route is hit, it just hangs, despite returning done(null, false) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment