-
Notifications
You must be signed in to change notification settings - Fork 98
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
verifyToken and others are empty #141
Comments
I wonder if the problem is not in the way you wrote the hook with the notifier, if you use brackets then you should use a return statement on the promise from the notifier, otherwise don't use brackets: By the way in case you did not notice the |
Hi @claustres, I think I see the issue. While debugger screenshot: https://www.evernote.com/l/ADolpWZziz9FwIN8F9YV-vabZKOqE-67ps4 I removed the removed the re the removeVerification hook - thanks for the heads up. I had not finished the article yet. I'll add them there too. |
This is a strange behavior, |
sequelize is building the insert like this after My users model looks like this and the columns are in the table ` module.exports = function (app) {
}, { users.associate = function (models) { return users; This is the signup after hook that creates the user `module.exports = (options = {}) => {
}; |
I bypassed signup and posted a new user with
The same behavior persisted |
solved... user error I had some junk in the users.class.js that was changing the data object. |
I followed this guide to set things up https://hackernoon.com/setting-up-email-verification-in-feathersjs-ce764907e4f2. email works, so, that's good. Now I'm working toward generating the verifyToken url. The part that's not working is setting the token in the URL. The tokens are not on the user by the time the url is generated.
Admittedly, I'm tired. Hopefully I'm just missing something simple.
note: I'm hitting
users.create
from another service calledsignup
sign up has no auth on it. signup.create keeps a record of the sign up and any other details that may not be involved in the actual user model. Organization name, for example.I can see that the tokens are getting created and added to the object in
verifyHooks.addVerification()
. Here's a screenshot of the state ofhook
just before it's returned. https://www.evernote.com/l/ADodJylat31J77RtYMYJpF4i6K8rwet-DtYAs you can see, the verifyToken is there. Here is the list of user before create hooks:
create: [hashPassword('password'), authenticate('jwt'), userCreateValidator(), verifyHooks.addVerification()],
I have stripped this down to
hashPassword('password'), verifyHooks.addVerification()
and tested. The behavior is the same.Here is the state of
context.data
just before triggering theresendVerifySignup
case in notifier.js https://www.evernote.com/l/ADoginovCKxK7KnbCiYHrYXP6y_m1UPVNQIAs you can see, they're on the
context.data
object.Then, in the notifier.js, the values are gone. Here's another screenshot: https://www.evernote.com/l/ADpZVElyGWJNb5kjyo511XLsYUJHJwAtqnI
Here are the user after create hooks:
create: [ addUserToOrg(), addUserToGroup(), context => { accountService(context.app).notifier('resendVerifySignup', context.result); }, verifyHooks.removeVerification()],
I have stripped this down to only
context => { accountService(context.app).notifier('resendVerifySignup', context.result); }, verifyHooks.removeVerification()
and tested. The behavior is the same.other details...
`
node v12.16.3
"dependencies": {
"@feathersjs/authentication": "^4.5.3",
"@feathersjs/authentication-local": "^4.5.3",
"@feathersjs/authentication-oauth": "^4.5.3",
"@feathersjs/configuration": "^4.5.3",
"@feathersjs/errors": "^4.5.3",
"@feathersjs/express": "^4.5.3",
"@feathersjs/feathers": "^4.5.3",
"@feathersjs/socketio": "^4.5.3",
"@feathersjs/transport-commons": "^4.5.3",
"aws-sdk": "^2.673.0",
"compression": "^1.7.4",
"cors": "^2.8.5",
"feathers-authentication-management": "^2.0.1",
"feathers-hooks-common": "^5.0.3",
"feathers-mailer": "^3.0.1",
"feathers-sequelize": "^6.1.0",
"helmet": "^3.22.0",
"jwt-decode": "^2.2.0",
"node-redshift": "^0.1.5",
"nodemailer-smtp-transport": "^2.7.4",
"pg": "^8.0.3",
"sequelize": "^5.21.7",
"serve-favicon": "^2.5.0",
"winston": "^3.2.1"
},`
The text was updated successfully, but these errors were encountered: