passport-local (2024)

passport-local (1)passport-local (2)passport-local (3)passport-local (4)passport-local (5)

Passport strategy for authenticating with a usernameand password.

This module lets you authenticate using a username and password in your Node.jsapplications. By plugging into Passport, local authentication can be easily andunobtrusively integrated into any application or framework that supportsConnect-style middleware, includingExpress.

Install

$ npm install passport-local

Usage

Configure Strategy

The local authentication strategy authenticates users using a username andpassword. The strategy requires a verify callback, which accepts thesecredentials and calls done providing a user.

See Also
passport

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, toauthenticate requests.

For example, as route middleware in an Expressapplication:

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

Examples

For complete, working examples, refer to the multiple examples included.

Tests

$ npm install$ npm test

Credits

License

The MIT License

Copyright (c) 2011-2014 Jared Hanson <http://jaredhanson.net/>

npm install passport-local

  • 1.0.0 published a year ago
  • 155,003 downloads in the last day
  • 810,137 downloads in the last week
  • 3,550,747 downloads in the last month
passport-local (2024)
Top Articles
The one thing Albert Einstein would say about investing
800,000 Unregistered SIM Cards Blocked as Safaricom Implements Government Directive
Victor Spizzirri Linkedin
Dricxzyoki
The Best Classes in WoW War Within - Best Class in 11.0.2 | Dving Guides
Produzione mondiale di vino
Danielle Longet
What’s the Difference Between Cash Flow and Profit?
Little Rock Arkansas Craigslist
zopiclon | Apotheek.nl
Dutchess Cleaners Boardman Ohio
Overton Funeral Home Waterloo Iowa
Viprow Golf
9044906381
Dr Adj Redist Cadv Prin Amex Charge
Equipamentos Hospitalares Diversos (Lote 98)
Alexander Funeral Home Gallatin Obituaries
Star Wars: Héros de la Galaxie - le guide des meilleurs personnages en 2024 - Le Blog Allo Paradise
Praew Phat
Spider-Man: Across The Spider-Verse Showtimes Near Marcus Bay Park Cinema
Apply for a credit card
Nearest Walgreens Or Cvs Near Me
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Barber Gym Quantico Hours
Maxpreps Field Hockey
Lexus Credit Card Login
Ficoforum
Select Truck Greensboro
Shia Prayer Times Houston
897 W Valley Blvd
Nurofen 400mg Tabletten (24 stuks) | De Online Drogist
Craigslist/Phx
100 Million Naira In Dollars
The Venus Flytrap: A Complete Care Guide
Wbli Playlist
Selfservice Bright Lending
Solemn Behavior Antonym
Imperialism Flocabulary Quiz Answers
Ise-Vm-K9 Eol
Frommer's Philadelphia &amp; the Amish Country (2007) (Frommer's Complete) - PDF Free Download
Callie Gullickson Eye Patches
Beaufort SC Mugshots
Carteret County Busted Paper
Tableaux, mobilier et objets d'art
Ehome America Coupon Code
Whitney Wisconsin 2022
DL381 Delta Air Lines Estado de vuelo Hoy y Historial 2024 | Trip.com
Headlining Hip Hopper Crossword Clue
17 of the best things to do in Bozeman, Montana
Doelpuntenteller Robert Mühren eindigt op 38: "Afsluiten in stijl toch?"
Wayward Carbuncle Location
Latest Posts
Article information

Author: Arielle Torp

Last Updated:

Views: 6287

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Arielle Torp

Birthday: 1997-09-20

Address: 87313 Erdman Vista, North Dustinborough, WA 37563

Phone: +97216742823598

Job: Central Technology Officer

Hobby: Taekwondo, Macrame, Foreign language learning, Kite flying, Cooking, Skiing, Computer programming

Introduction: My name is Arielle Torp, I am a comfortable, kind, zealous, lovely, jolly, colorful, adventurous person who loves writing and wants to share my knowledge and understanding with you.