
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@briebug/passport-custom
Advanced tools
Custom authentication strategy for Passport (supports @nestjs/passport).
Passport strategy for authenticating with custom logic.
This module lets you authenticate using custom logic in your Node.js applications. It is based on passport-local module by Jared Hanson. By plugging into Passport, custom authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.
$ npm install passport-custom
The custom authentication strategy authenticates users by custom logic of your choosing.
The strategy requires a verify callback, which is where the custom logic goes and calls
done providing a user. Note that, req is always passed as the first parameter to the
verify callback.
Here is the pseudo code:
import passportCustom from 'passport-custom';
const CustomStrategy = passportCustom.Strategy;
passport.use('strategy-name', new CustomStrategy(
{},
function(req, callback) {
// Do your custom user finding logic here, or set to false based on req object
callback(null, user);
}
));
And a basic example:
passport.use(new CustomStrategy(
function(req, done) {
User.findOne({
username: req.body.username
}, function (err, user) {
done(err, user);
});
}
));
Use passport.authenticate(), specifying the 'custom' strategy (or whatever you named the strategy upon registration), to
authenticate requests.
For example, as route middleware in an Express application:
app.post('/login',
passport.authenticate('custom', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
}
);
$ npm install
$ npm test
Copyright (c) 2014-2015 Mike Bell
FAQs
Custom authentication strategy for Passport (supports @nestjs/passport).
The npm package @briebug/passport-custom receives a total of 12 weekly downloads. As such, @briebug/passport-custom popularity was classified as not popular.
We found that @briebug/passport-custom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.