-
-
Save mzarella/38fd6f464d5f85c5050d to your computer and use it in GitHub Desktop.
This file contains 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
var app = require('express')(); | |
var server = require('http').Server(app); | |
var session = require('express-session'); | |
var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; | |
var bodyParser = require('body-parser') | |
app.use(bodyParser.json()) | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})) | |
passport.use(new LocalStrategy({ | |
usernameField: 'email', | |
passwordField: 'password' | |
}, function(email, password, done) { | |
debugger; | |
} | |
)); | |
app.use(session({ | |
secret: 'keyboard cat', | |
resave: false, | |
saveUninitialized: true | |
})); | |
app.use(passport.initialize()); | |
app.use(passport.session()); | |
app.post('/login', function(req, res, next) { | |
passport.authenticate('local', function(err, user, info) { | |
debugger; | |
})(req, res, next); | |
}) | |
server.listen(3000) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i think that i want to be hitting l17 so that i can verify the user's credentials, correct?