feathersjs-ecosystem / feathers-authentication-ldap

LDAP authentication strategy for feathers-authentication using Passport
MIT License
19 stars 4 forks source link

No ldap provider when used with feathers-cli generate #4

Closed bnielsen1965 closed 7 years ago

bnielsen1965 commented 7 years ago

When implementing feathers-authentication-ldap in a scaffolding created with the command feathers-cli generate the ldap provider does not register. Starting the application produces the following error message...

/home/bnielsen/feathersjs/test/node_modules/feathers-authentication/lib/index.js:184
      app.configure(provider(options));
                    ^

TypeError: provider is not a function
    at /home/bnielsen/feathersjs/test/node_modules/feathers-authentication/lib/index.js:184:21
    at Array.forEach (native)
    at EventEmitter.<anonymous> (/home/bnielsen/feathersjs/test/node_modules/feathers-authentication/lib/index.js:154:25)
    at EventEmitter.configure (/home/bnielsen/feathersjs/test/node_modules/feathers/lib/application.js:138:8)
    at EventEmitter.module.exports (/home/bnielsen/feathersjs/test/src/services/authentication/index.js:13:7)
    at EventEmitter.configure (/home/bnielsen/feathersjs/test/node_modules/feathers/lib/application.js:138:8)
    at EventEmitter.module.exports (/home/bnielsen/feathersjs/test/src/services/index.js:9:7)
    at EventEmitter.configure (/home/bnielsen/feathersjs/test/node_modules/feathers/lib/application.js:138:8)
    at Object.<anonymous> (/home/bnielsen/feathersjs/test/src/app.js:31:4)
    at Module._compile (module.js:409:26)

Steps to reproduce the error...

const authentication = require('feathers-authentication'); const ldap = require('feathers-authentication-ldap');

module.exports = function() { const app = this;

let config = app.get('auth');

app.configure(authentication(config)).configure(ldap()); };


* Atempt to start the application   node src/index.js

I'm sure there is something wrong with the way I am setting up the ldap provider but so far I can't go from the example code that works to a working implementation in the generated scaffolding.

**UPDATE**

The problem is that feathers-cli is installing an old version of feathers-authentication.