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

auth.express.authenticate got undefined #363

Closed
jinwyp opened this Issue Dec 9, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@jinwyp
Copy link

jinwyp commented Dec 9, 2016

Just follow the doc

app.post('/login', auth.express.authenticate('local', { successRedirect: '/app', failureRedirect: '/login' }));

got error " read property 'authenticate' of undefined"

/Users/tttt/Documents/github/featherjsdemo/backend/src/services/user/index.js:40
    app.post('/api/user/password', auth.express.authenticate('jwt'), userInfoController.changePassword(app));
                                               ^

TypeError: Cannot read property 'authenticate' of undefined
    at EventEmitter.module.exports (/Users/tttt/Documents/github/featherjsdemo/backend/src/services/user/index.js:40:48)
    at EventEmitter.configure (/Users/tttt/Documents/github/featherjsdemo/backend/node_modules/feathers/lib/application.js:138:8)
    at EventEmitter.module.exports (/Users/tttt/Documents/github/featherjsdemo/backend/src/services/index.js:15:7)
    at EventEmitter.configure (/Users/tttt/Documents/github/featherjsdemo/backend/node_modules/feathers/lib/application.js:138:8)
    at Object.<anonymous> (/Users/tttt/Documents/github/featherjsdemo/backend/src/app.js:41:6)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/tttt/Documents/github/featherjsdemo/backend/src/index.js:3:13)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)

@jinwyp jinwyp changed the title auth.express.authenticate got auth.express.authenticate got undefined Dec 9, 2016

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Dec 9, 2016

Are you sure you installed version 1.0.0-beta and not 0.7.x? You have to install the version explicitly, just npm install feathers-authentication will still get you 0.7

@jinwyp

This comment has been minimized.

Copy link
Author

jinwyp commented Dec 9, 2016

I installed version 0.7.12, Should I install 1.0.0-beta to get auth.express middleware ?

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Dec 9, 2016

Yes

@jinwyp

This comment has been minimized.

Copy link
Author

jinwyp commented Dec 9, 2016

Thanks.

@jinwyp jinwyp closed this Dec 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.