Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passport-ldapauth

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-ldapauth - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

10

lib/passport-ldapauth/strategy.js

@@ -60,4 +60,2 @@ "use strict";

this.options.passwordField || (this.options.passwordField = 'password');
this.ldap = new LdapAuth(this.options.server);
};

@@ -102,3 +100,3 @@

Strategy.prototype.authenticate = function(req, options) {
var username, password, self;
var username, password, ldap, self;
options || (options = {});

@@ -112,6 +110,8 @@

self = this;
self.ldap.authenticate(username, password, function(err, user) {
ldap = new LdapAuth(self.options.server);
ldap.authenticate(username, password, function(err, user) {
ldap.close(function(){}); // We don't care about the closing
if (err) {
// Invalid credentials / user not found are not errors but login failures
if (err.name === 'InvalidCredentialsError' || err.match(/no such user/i)) {
if (err.name === 'InvalidCredentialsError' || (typeof err === 'string' && err.match(/no such user/i))) {
return self.fail('Invalid username/password');

@@ -118,0 +118,0 @@ }

@@ -11,3 +11,3 @@ {

],
"version": "0.0.4",
"version": "0.0.5",
"license": {

@@ -14,0 +14,0 @@ "type": "MIT",

@@ -42,2 +42,7 @@ # passport-ldapauth

## Status
[![Build Status](https://travis-ci.org/vesse/passport-ldapauth.png)](https://travis-ci.org/vesse/passport-ldapauth)
[![Dependency Status](https://gemnasium.com/vesse/passport-ldapauth.png)](https://gemnasium.com/vesse/passport-ldapauth)
## Configuration options

@@ -44,0 +49,0 @@

@@ -54,4 +54,5 @@ var should = require('chai').Should(),

it("should throw an error if options are not accepted by ldapauth", function(cb) {
var s = new LdapStrategy({}, function() {});
(function() {
new LdapStrategy({}, function() {});
s.authenticate({body: {username: 'valid', password: 'valid'}});
}).should.throw(Error);

@@ -58,0 +59,0 @@ cb();

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