Send informative email for already confirmed users
Currently the application does not send any email to confirm the account for already confirmed users. But we show a notice message that may look like you will recive one: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." In this commit we keep the original message, but send an email to the user informing them that their account is now registered. This way no one can know if someone else's account is confirmed and we don't have to worry about GDPR either. Co-Authored-By: taitus <sebastia.roig@gmail.com>
This commit is contained in:
@@ -1,4 +1,17 @@
|
||||
class Users::ConfirmationsController < Devise::ConfirmationsController
|
||||
# POST /resource/confirmation
|
||||
def create
|
||||
self.resource = resource_class.send_confirmation_instructions(resource_params)
|
||||
yield resource if block_given?
|
||||
|
||||
if successfully_sent?(resource)
|
||||
Mailer.already_confirmed(resource).deliver_later unless resource.confirmation_required?
|
||||
respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name))
|
||||
else
|
||||
respond_with(resource)
|
||||
end
|
||||
end
|
||||
|
||||
# new action, PATCH does not exist in the default Devise::ConfirmationsController
|
||||
# PATCH /resource/confirmation
|
||||
def update
|
||||
|
||||
Reference in New Issue
Block a user