Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Version bumped to 1.2.0 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ldap_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ Meteor.loginWithLDAP = function (user, password, customLdapOptions, callback) {
ldapOptions: customLdapOptions
});


Accounts.callLoginMethod({
// Call login method with ldap = true
// This will hook into our login handler for ldap
methodArguments: [loginRequest],
userCallback: function (error, result) {
userCallback: function (error) {
if (error) {
callback && callback(error);
} else {
Expand Down
9 changes: 5 additions & 4 deletions ldap_server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Future = Npm.require('fibers/future');
MeteorWrapperLdapjs = Npm.require('ldapjs');

// At a minimum, set up LDAP_DEFAULTS.url and .dn according to
// your needs. url should appear as 'ldap://your.url.here'
Expand Down Expand Up @@ -63,11 +64,11 @@ LDAP.create.prototype.ldapCheck = function (options, bindAfterFind) {

if ((options.hasOwnProperty('username') && options.hasOwnProperty('ldapPass')) || !bindAfterFind) {

var ldapAsyncFut = new Future();
const ldapAsyncFut = new Future();


// Create ldap client
var fullUrl = self.options.url + ':' + self.options.port;
const fullUrl = self.options.url + ':' + self.options.port;
var client = null;

if (self.options.url.indexOf('ldaps://') === 0) {
Expand Down Expand Up @@ -243,11 +244,11 @@ Accounts.registerLoginHandler('ldap', function (loginRequest) {
}

// Instantiate LDAP with options
var userOptions = loginRequest.ldapOptions || {};
const userOptions = loginRequest.ldapOptions || {};
Accounts.ldapObj = new LDAP.create(userOptions);

// Call ldapCheck and get response
var ldapResponse = Accounts.ldapObj.ldapCheck(loginRequest, true);
const ldapResponse = Accounts.ldapObj.ldapCheck(loginRequest, true);

if (ldapResponse.error) {
return {
Expand Down
9 changes: 5 additions & 4 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Package.describe({
name: 'typ:accounts-ldap',
version: '1.1.0',
version: '1.2.0',
summary: 'Accounts login for LDAP using ldapjs. Supports anonymous DN search & LDAPS.',
git: 'https://github.com/typ90/meteor-accounts-ldap',
documentation: 'README.md'
});


Package.onUse(function(api) {
api.versionsFrom('1.0.3.1');
api.versionsFrom('1.4.4.1');

api.use(['templating'], 'client');
api.use(['typ:[email protected]'], 'server');

Npm.depends({
ldapjs: '1.0.1'
});

api.use('accounts-base', 'server');
api.imply('accounts-base', ['client', 'server']);
Expand Down