Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ password. The strategy requires a `verify` callback, which accepts these
credentials and calls `done` providing a user.

```js
const LocalStrategy = require('passport-local')
// ...
passport.use(new LocalStrategy(
function(username, password, done) {
User.findOne({ username: username }, function (err, user) {
Expand Down Expand Up @@ -115,7 +117,7 @@ For example, as route middleware in an [Express](http://expressjs.com/)
application:

```js
app.post('/login',
app.post('/login',
passport.authenticate('local', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
Expand Down