-
Notifications
You must be signed in to change notification settings - Fork 98
Support multiple ways of communicating with user #1
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
Comments
Migration from feathers-service-verify-reset:
verifyReset.create({
action: 'passwordChange',
value: { oldPassword: plainPassword, password: plainNewPassword },
}, { user: paramsUser }, cb) to verifyReset.create({
action: 'passwordChange',
value: { user: { email }, oldPassword: plainPassword, password: plainNewPassword },
}, {}, cb)
verifyReset.create({
action: 'emailChange',
value: { password: plainPassword, email: newEmail },
}, { user: paramsUser }, cb) to verifyReset.create({
action: 'identityChange',
value: { user: { email }, password: plainPassword, changes: { email, cellphone } },
}, {}, cb)
const isAction = (...args) => hook => args.includes(hook.data.action);
before: {
create: [
hooks.iff(isAction('passwordChange', 'emailChange'), auth.verifyToken()),
hooks.iff(isAction('passwordChange', 'emailChange'), auth.populateUser()),
],
}, or for feathers-authenticate v1.0 const isAction = (...args) => hook => args.includes(hook.data.action);
before: {
create: [
hooks.iff(isAction('passwordChange', 'emailChange'), auth.hooks.authenticate('jwt')),
hooks.iff(isAction('passwordChange', 'emailChange'), auth.populateUser()),
],
}, |
Docs for Auk branch of Feathers GitBook have been pushed, waiting for review. |
nice~! |
@beeplin, you may want to check feathers-hooks-populate to see if it could be useful to you. Comments are invited. FYI, it does not automatically populate items in hook.params, just hook.data and hook.result. I did not see a clear need for hook.params, plus a fake hook could always be created to handle this. |
sure, thanks :) |
I checked the doc and will try it in my projects. Thanks for the wonderful design. Again, I still didn't quite catch how the new permission string works. Is any new doc for feathers-permissions available now? And, I still don't see why we need both query and select at the same time. I think they are one thing. Did I miss something? BTW what is the current status of this repo (management)? Since now it is a part of Auk, does that mean it will not be officially released until Auk is ready for production? And when will this happen? Eager to use it :))) |
`feathers-authentication-management` is ready for testing in live apps.
ekryski will be putting it into an existing app, but he is rather tied up
right now. Feel free to give it a try. The docs will be released with Auk.
You can see Auk docs using the dropdown in the left column of feathers
GitBook.
ekryski is still working this weekend on `feathers-permissions`. I believe
he's planning to start getting authentication v1.0 and permissions docs out
this week.
The previous populate hook design had permissions baked into the hook. It
was felt during a code review that this was too confusing. The new design
externalizes how permissions and schemas are controlled. I'll write a
default permissions func which uses `feathers-permissions` once I myself
understand its design.
Query and select are very similar. I just felt separating them made it
easier to explain. BTW the final `find({ query: {} })` is basically formed
with `Object.assign({}, query, { childField: ParentField }, select)` so
select overides the rest.
…On Sun, Dec 4, 2016 at 8:34 PM, Beep LIN ***@***.***> wrote:
I checked the doc and will try it in my projects. Thanks for the wonderful
design.
Again, I still didn't quite catch how the new permission string works. Is
any new doc for feathers-permissions available now?
And, I still don't see why we need both query and select at the same time.
I think they are one thing. Did I miss something?
BTW what is the current status of this repo (management)? Since now it is
a part of Auk, does that mean it will not be officially released until Auk
is ready for production? And when will this happen? Eager to use it :)))
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABezn6JV6v3v89B9tRrscLwe_dLG-ppvks5rE2oRgaJpZM4K5W19>
.
|
got it. excited! |
@beeplin, serialize hook added. It removes unwanted data from populated items, and adds computed values. |
@beeplin I've tried to extract what you propose into concrete changes. Could you please see if these are complete?
Changes to do before release
options.userPropsForShortToken
tooptions.identifyUserProps
.checkUniqueness(uniques, ownId, meta)
OKresendVerifySignup(emailOrToken, notifierOptions)
notifer
usesuser.primaryCommunication
to route notification.verifySignupWithLongTokenverifySignupWithLongToken(verifyToken)
OKverifySignupWithShortToken(verifyShortToken, findUser)
OKsendResetPwd(email, notifierOptions)
notifer
usesuser.primaryCommunication
to route notification.resetPwdWithLongToken(resetToken, password)
OKresetPwdWithShortToken(resetShortToken, findUser, password)
OKpasswordChange(user, oldPassword, password)
[edit]user.email
is used. find user with any props in options.identifyUserProps [edit]emailChange(user, password, email)
identityChange
instead ofemailChange
user.verifyChanges
to { prop: value }userNotifier
to send the verify tokens like resendVerifySignup does now.verifyChanges
contains the props that will be changed on verificationnewEmail
is therefore no longer neededverifyChanges
prop !==user.primaryCommunication
verifyChanges
prop ===user.primaryCommunication
user.primaryCommunication
one.verifySignup(query, tokens)
: called by verifySignupWithLongToken and verifySignupWithShortTokenuser.verifyChanges
along with verifyToken, verifyTokenShort and verifyExpires.sendResetPwd(identifyUser, notifierOptions)
, not(email, notifierOptions)
passwordChange(oldPassword, password, identifyUser)
, not(oldPassword, password, user)
identityChange(password, changesIdentifyUser, identifyUser)
, notemailChange(password, email, user)
user.verifyProp
= {} on initial creation of user so that case is not different than identityChange.sanitizeUserForEmail
tosanitizeUserForNotifier
. [edit]$className
specific enough to map to error messages on the UI.user
andorganization
authentications at the same time.authenticate
?The text was updated successfully, but these errors were encountered: