passport-ldapauth
Advanced tools
Comparing version 0.2.4 to 0.2.5
## Changes | ||
* v0.2.5 | ||
* [#21](https://github.com/vesse/passport-ldapauth/issues/21) - Handle `constraintViolationError` as a login failure instead of an error. | ||
* v0.2.4 | ||
@@ -4,0 +6,0 @@ * Inherit from [passport-strategy](https://github.com/jaredhanson/passport-strategy) like `passport-local` and others do. |
@@ -126,2 +126,4 @@ "use strict"; | ||
* (default: 'Invalid username/password') | ||
* - `constraintViolation` flash message when user account is locked | ||
* (default: 'Exceeded password retry limit, account locked') | ||
*/ | ||
@@ -147,2 +149,5 @@ var handleAuthentication = function(req, options) { | ||
} | ||
if (err.name === 'ConstraintViolationError'){ | ||
return this.fail({message: options.constraintViolation || 'Exceeded password retry limit, account locked'}, 401); | ||
} | ||
// Other errors are (most likely) real errors | ||
@@ -149,0 +154,0 @@ return this.error(err); |
@@ -7,3 +7,4 @@ { | ||
"Simon Gaeremynck <gaeremyncks@gmail.com>", | ||
"Michael Bailly <mbailly@linagora.com>" | ||
"Michael Bailly <mbailly@linagora.com>", | ||
"Jason Gelinas <jason.gelinas@citi.com>" | ||
], | ||
@@ -16,3 +17,3 @@ "keywords": [ | ||
], | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"license": { | ||
@@ -19,0 +20,0 @@ "type": "MIT", |
@@ -62,2 +62,3 @@ # passport-ldapauth | ||
* `userNotFound` flash message when LDAP returns no error but also no user (default: 'Invalid username/password') | ||
* `constraintViolation` flash message when user account is locked (default: 'Exceeded password retry limit, account locked') | ||
@@ -64,0 +65,0 @@ ## Express example |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
158
0
24415
11
450