-
Notifications
You must be signed in to change notification settings - Fork 384
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: set hook for email change when only phone identity present #1865
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12375398184Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Are you ready to move this out of draft @J0 - change looks good. |
Thanks for looking through the PRs! Have manually tested here but wanted to also:
|
if emailActionType == mail.EmailChangeVerification && !config.Mailer.SecureEmailChangeEnabled && u.GetEmail() != "" { | ||
otp = otpNew | ||
} | ||
|
||
emailData := mail.EmailData{ | ||
Token: otp, |
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.
Currently, there is no token passed in into the email hook when an email change is attempted right after a phone sign up.
what is the initial value of otp
here?
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.
Should be ""
if there's secure email change is not enabled. If it's enabled, and there's no phone linked to it it doesn't get set so it remains as ""
.
// When secure email change is disabled, we place the token for the new email on emailData.Token | ||
if !config.Mailer.SecureEmailChangeEnabled { | ||
// Token Hash should already be set above | ||
emailData.Token = otpNew |
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.
does this mean that the actual value in TokenHash
will be different from the otpNew
?
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.
what is the value of ignore (typo)
What kind of change does this PR introduce?
Currently, there is no token passed in into the email hook when an email change is attempted right after a phone sign up.