-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix: Can't re-send shop manager invite to existing non-activated user #5178
fix: Can't re-send shop manager invite to existing non-activated user #5178
Conversation
Signed-off-by: Loan Laux <loan@outgrow.io>
Signed-off-by: Loan Laux <loan@outgrow.io>
…en and send new invite Signed-off-by: Loan Laux <loan@outgrow.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment in two places, but otherwise I think this can be merged. Thanks @loan-laux !
imports/plugins/core/accounts/client/components/adminInviteForm.js
Outdated
Show resolved
Hide resolved
imports/plugins/core/accounts/server/methods/inviteShopMember.js
Outdated
Show resolved
Hide resolved
Ping @loan-laux |
Sorry @aldeed, I was on vacation and just came back today. I'll implement the requested changes today. |
Signed-off-by: Loan Laux <loan@outgrow.io>
798c5e5
to
71697cb
Compare
@aldeed Let me know if this fix is what you had in mind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small modifications needed.
imports/plugins/core/accounts/server/methods/inviteShopMember.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Loan Laux <loan@outgrow.io>
Signed-off-by: Loan Laux <loan@outgrow.io>
…action into outgrow-fix-admin-invite-flow
Good catch @willopez, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
integration tests failing due to this known issue: #5246. I have verified all tests pass locally. |
@loan-laux thank you for your contribution 👍 |
Resolves #5176
Impact: major
Type: bugfix
Issue
After sending a shop manager invite to a non-registered e-mail, a new user is created for them with a token to be used to set their password. An e-mail invite is then sent with a URL containing this token.
However, if you want to re-send an invitation to this same person, the
accounts/inviteShopMember
will see an existing account for this e-mail, not checking whether it was activated or not. This means that no new "set password" token will be sent, and the user will be promoted to shop manager (which it already was), as if it was an already active account.Solution
In the
accounts/inviteShopMember
logic, if an account already exists for the e-mail address but isn't activated yet, generate a new token and send a new invite.Also, add some confirmation dialogs in case an e-mail already exists, whether it's activated or not.
Breaking changes
None.
Testing
Accounts
page of the operator, invite an e-mail address that's already registered and activated.