feathers-authentication-management: authManagement:verifySignup - Method: create: users.find is not a function
- The feathers app was initially created used the cli generator.
- The auth manager is initialized after all other services.
- After the user is created, the verify email is sent.
- Clicking the link, the client app calls
verifySignupLong(token). - Then on the server, the auth manager
verifySignupWithLongTokenfunction is called, which should call the users service, but the I get this error:
authManagement:main service called. action=verifySignupLong +35s
authManagement:verifySignup verifySignup { verifyToken: 'c18b98c317d6bd5ca99b92a338dc0c' } { verifyToken: 'c18b98c317d6bd5ca99b92a338dc0c' } +54s
info: error: authManagement - Method: create: users.find is not a function
error: TypeError: users.find is not a function
at verifySignup (/app/node_modules/feathers-authentication-management/lib/verifySignup.js:38:16)
at /app/node_modules/feathers-authentication-management/lib/verifySignup.js:18:12
at process._tickCallback (internal/process/next_tick.js:103:7)
The strange thing is that only if I restart the server the call is done without errors and it recognize the users service.
For now I had to make a workaround:
I cloned this repo and passed the users service in the main auth manager function.
app.configure(authManagement({
users: app.service('users'),
notifier,
}));
then I changed all repo users service calls to this:
// const users = options.app.service(options.service);
const users = options.users;
It worked well, but I want to understand what’s wrong here, I don’t have time to recreate the whole app from ground zero as this has already took me much time and really want to use this package without workarounds.
Lastly, why the context of this feathers app is also wrong tough the auth manager is configured after all other services?
Thanks
"feathers": "^2.2.0",
"feathers-authentication": "^1.2.7",
"feathers-authentication-hooks": "^0.1.4",
"feathers-authentication-jwt": "^0.3.2",
"feathers-authentication-local": "^0.4.4",
"feathers-authentication-management": "^1.0.0",
"feathers-authentication-oauth2": "^0.2.5",
"feathers-configuration": "^0.4.1",
"feathers-errors": "^2.9.2",
"feathers-hooks": "^2.0.2",
"feathers-hooks-common": "^3.7.2",
"feathers-mongoose": "^5.1.2",
"feathers-rest": "^1.8.0",
"feathers-socketio": "^2.0.0",
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 24
I’m on vacation till Jan 10. I can look into these items when I return. I might need @marshallswain 's input.
I will look into this when I return from vacation next Wednesday.