diff options
| author | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-04-16 13:17:06 +0000 |
|---|---|---|
| committer | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-04-16 13:17:06 +0000 |
| commit | dc46b87abee1e441c07524ddde67fd902a919336 (patch) | |
| tree | 13eba08b8655dfd78e9600ec5f612011a0bf3b35 /node_modules/passport-local/README.md | |
| parent | 26f4b38e9e5a202756a7c33abc775aea2617aeaf (diff) | |
added some dependencies to package.json
Diffstat (limited to 'node_modules/passport-local/README.md')
| -rw-r--r-- | node_modules/passport-local/README.md | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/node_modules/passport-local/README.md b/node_modules/passport-local/README.md deleted file mode 100644 index 7ab1b66..0000000 --- a/node_modules/passport-local/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# passport-local - -[](https://travis-ci.org/jaredhanson/passport-local) -[](https://coveralls.io/r/jaredhanson/passport-local) -[](https://codeclimate.com/github/jaredhanson/passport-local) -[](https://david-dm.org/jaredhanson/passport-local) -[](https://www.gittip.com/jaredhanson/) - - -[Passport](http://passportjs.org/) strategy for authenticating with a username -and password. - -This module lets you authenticate using a username and password in your Node.js -applications. By plugging into Passport, local authentication can be easily and -unobtrusively integrated into any application or framework that supports -[Connect](http://www.senchalabs.org/connect/)-style middleware, including -[Express](http://expressjs.com/). - -## Install - - $ npm install passport-local - -## Usage - -#### Configure Strategy - -The local authentication strategy authenticates users using a username and -password. The strategy requires a `verify` callback, which accepts these -credentials and calls `done` providing a user. - - passport.use(new LocalStrategy( - function(username, password, done) { - User.findOne({ username: username }, function (err, user) { - if (err) { return done(err); } - if (!user) { return done(null, false); } - if (!user.verifyPassword(password)) { return done(null, false); } - return done(null, user); - }); - } - )); - -#### Authenticate Requests - -Use `passport.authenticate()`, specifying the `'local'` strategy, to -authenticate requests. - -For example, as route middleware in an [Express](http://expressjs.com/) -application: - - app.post('/login', - passport.authenticate('local', { failureRedirect: '/login' }), - function(req, res) { - res.redirect('/'); - }); - -## Examples - -For complete, working examples, refer to the multiple [examples](https://github.com/jaredhanson/passport-local/tree/master/examples) included. - -## Tests - - $ npm install - $ npm test - -## Credits - - - [Jared Hanson](http://github.com/jaredhanson) - -## License - -[The MIT License](http://opensource.org/licenses/MIT) - -Copyright (c) 2011-2014 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> |
