New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

darklord

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

darklord - npm Package Compare versions

Comparing version 1.5.3 to 1.6.0

2

package.json
{
"name": "darklord",
"version": "1.5.3",
"version": "1.6.0",
"author": "Gregory Pratt <gregory.pratt@me.com> (http://grumpywizards.com)",

@@ -5,0 +5,0 @@ "description": "Stateless JWT based authentication",

@@ -21,2 +21,3 @@ ## DarkLord - JWT based stateless authentication

user: <passport based user model>,
passwordValidator: <regex condition>
databaseSvc: <database logic controller>,

@@ -32,2 +33,4 @@ router: <express router>

**passwordValidator** (*optional*) - use a Regular Expression to password validity e.g. `/^.{6,}$/` for minimum length of 6
**databaseSvc** (*optional*) - if you are building your own User model and you don't want to use Mongo as a database then you probably already have a database logic layer. That's cool, you can provide DarkLord a database service that has the following interface where ***each method must return a promise***.:

@@ -34,0 +37,0 @@

@@ -28,15 +28,18 @@ var Cookies = require('cookies');

function register(req, res, next) {
User.register({
email: req.body.email,
verifyToken: uuid.v4()
}, req.body.password, function (err, user) {
console.log('ok', err);
if (err) {
res.status(400).send({ error: err });
} else {
// User created
emitter.emit('registered', user);
authenticate(req, res, next);
}
});
if (opts.passwordValidator && !opts.passwordValidator.test(req.body.password)) {
res.status(400).end();
} else {
User.register({
email: req.body.email,
verifyToken: uuid.v4()
}, req.body.password, function (err, user) {
if (err) {
res.status(400).send({ error: err });
} else {
// User created
emitter.emit('registered', user);
authenticate(req, res, next);
}
});
}
}

@@ -43,0 +46,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc