Gathering detailed insights and metrics for passport-local
Gathering detailed insights and metrics for passport-local
Gathering detailed insights and metrics for passport-local
Gathering detailed insights and metrics for passport-local
Username and password authentication strategy for Passport and Node.js.
npm install passport-local
Typescript
Module System
Min. Node Version
NPM Version
99.2
Supply Chain
89.5
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (98.74%)
Makefile (1.26%)
Total Downloads
184,179,027
Last Day
56,641
Last Week
637,512
Last Month
3,611,980
Last Year
43,261,590
2,736 Stars
141 Commits
498 Forks
56 Watching
1 Branches
15 Contributors
Latest Version
1.0.0
Package Id
passport-local@1.0.0
Size
3.28 kB
NPM Version
1.2.25
Publised On
08 Mar 2014
Cumulative downloads
Total Downloads
Last day
-65.2%
56,641
Compared to previous day
Last week
-27.4%
637,512
Compared to previous week
Last month
-5.2%
3,611,980
Compared to previous month
Last year
11.7%
43,261,590
Compared to previous year
1
3
Passport 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-style middleware, including Express.
$ npm install passport-local
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);
});
}
));
Use passport.authenticate()
, specifying the 'local'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app.post('/login',
passport.authenticate('local', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
For complete, working examples, refer to the multiple examples included.
$ npm install
$ npm test
Copyright (c) 2011-2014 Jared Hanson <http://jaredhanson.net/>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More