ldapauth-fork
Advanced tools
Comparing version 2.2.8 to 2.2.9
@@ -16,3 +16,2 @@ /** | ||
var assert = require('assert'); | ||
var bcrypt = require('bcrypt'); | ||
var ldap = require('ldapjs'); | ||
@@ -88,3 +87,6 @@ var debug = console.warn; | ||
this._salt = bcrypt.genSaltSync(); | ||
if (opts.cache) { | ||
var bcrypt = require('bcrypt'); | ||
this._salt = bcrypt.genSaltSync(); | ||
} | ||
} | ||
@@ -195,2 +197,3 @@ | ||
var cached = self.userCache.get(username); | ||
var bcrypt = require('bcrypt'); | ||
if (cached && bcrypt.compareSync(password, cached.password)) { | ||
@@ -214,2 +217,3 @@ return callback(null, cached.user) | ||
if (self.opts.cache) { | ||
var bcrypt = require('bcrypt'); | ||
bcrypt.hash(password, self._salt, function (err, hash) { | ||
@@ -216,0 +220,0 @@ self.userCache.set(username, {password: hash, user: user}); |
{ | ||
"name": "ldapauth-fork", | ||
"version": "2.2.8", | ||
"version": "2.2.9", | ||
"main": "./lib/ldapauth.js", | ||
@@ -26,5 +26,7 @@ "description": "Authenticate against an LDAP server", | ||
"ldapjs": "0.6.3", | ||
"bcrypt": "0.7.5", | ||
"lru-cache": "2.0.4" | ||
}, | ||
"optionalDependencies": { | ||
"bcrypt": "0.7.5" | ||
} | ||
} |
@@ -9,3 +9,3 @@ Fork of [node-ldapauth](https://github.com/trentm/node-ldapauth) - A simple node.js lib to authenticate against an LDAP server. | ||
version supports passing `tlsOptions` to the TLS module. Once the original | ||
module is updated I will likely abandon the fork. | ||
module is updated I will likely deprecate the fork. | ||
@@ -21,2 +21,3 @@ Changes in this fork include: | ||
* clients are unbound in `close()` ([#3](https://github.com/trentm/node-ldapauth/issues/3)) | ||
* `bcrypt` is an optional dependency ([#13](https://github.com/trentm/node-ldapauth/pull/13), also affects [#9](https://github.com/trentm/node-ldapauth/issues/9)) | ||
@@ -23,0 +24,0 @@ The additional options the changes above introduce are `searchScope`, `searchAttributes`, |
100
61763
4
12
282
- Removedbcrypt@0.7.5