not sure it is possible what we want to achieve, but any advice welcome.
Using devise 2.0.4 for authentication. All good. We have a settings view where users can change their email and/or password.
If they change their email address, since we have :confirmable on devise, their email address is not changed until they confirm the email to their new address.
Our issue is this, when a new email address confirmation is outstanding, changing something else, say password, still shows the user the flash message that they have to confirm their email. (Key in devise.en.yml: update_needs_confirmation). My client doesn't want this; what they want is for the :update_needs_confirmation message only to be shown if you have just changed your email address. Not after any other changes, even if the email was not yet confirmed.
Is this in any way possible? I gather it has something to do with the code in Devise's registrations controller #update method, particularly this section:
if resource.respond_to?(:pending_reconfirmation?) && resource.pending_reconfirmation?
flash_key = :update_needs_confirmation
end
Does anyone know if it can be achieved to show this flash message only once after each email change and how? Happy to override the controller as we have already done so for other reasons. (I know, bad)
many thanks for info!