Add primary email to emails even when skip_reconfirmation! called
What does this MR do and why?
Previously, in cases when skip_reconfirmation! was called before updating the primary email, the email (which is to be considered confirmed) would not be added to the emails table, because User#confirm was not called (see also this discussion).
Now instead of overriding User#confirm we use an after_save callback that checks if the primary email changed and if it is confirmed, and if so adds it to the emails. This works also in case skip_reconfirmation is called, and is also cleaner than overriding a Devise method.
This is towards solving #344134 (closed) and has to be merged before !77049 (merged)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.