Store updated email in unconfirmed_email #1531
Merged
Merged
Conversation
Contributor
|
👍 This is a good way to deal with email changes |
GBH
reviewed
Jan 1, 2017
| end | ||
|
|
||
| def unconfirmed_email_exists? | ||
| User.where(email: unconfirmed_email).exists? |
Contributor
There was a problem hiding this comment.
Should check against confirmed and unconfirmed emails. This is an edge condition but still:
- User A: usera@email changes to new@email
- User B: userb@email changes to new@email
Both confirm and it blows up in confirm_email! method for one of them
| private | ||
|
|
||
| def unconfirmed_email_uniqueness | ||
| errors.add(:email, "#{unconfirmed_email} already exists") if unconfirmed_email_exists? |
| "your account with your new email address." | ||
| redirect_to_root | ||
| "minutes. It contains instructions for confirming " \ | ||
| "your new email address." |
e167bcc to
28544f6
Compare
Closed
28544f6 to
9444a5c
Compare
when unconfirmed_email is verified with confirmation mail, it is copied to email field.
9444a5c to
72a90a5
Compare
Member
Author
|
Thanks for review @GBH 👍 I have included your suggestions and added option to re-sending confirmation mail for unconfirmed_email. |
|
Awesome. Thanks for implementing this, @sonalkr132! @homu r+ |
Contributor
|
📌 Commit bea5318 has been approved by |
Contributor
|
⚡ Test exempted - status |
homu
added a commit
that referenced
this pull request
Jan 5, 2017
Store updated email in unconfirmed_email Closes #1512 After update of email, new email address will be stored in `unconfirmed_email` until it is confirmed. Until new email email address is confirmed, user will see following and their old email will remain their effective email address. 
This was referenced Jan 5, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1512
After update of email, new email address will be stored in

unconfirmed_emailuntil it is confirmed. Until new email email address is confirmed, user will see following and their old email will remain their effective email address.