Updated ConfirmationsController to set new email after confirmation to unconfirmed email only

• Updated:
- ConfirmationsController to set new email after confirmation to unconfirmed email only
This commit is contained in:
Developer 2021-02-19 21:57:09 -05:00
parent c01328c8a0
commit 58a8a17bfe
1 changed files with 1 additions and 8 deletions

View File

@ -13,14 +13,7 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController
def finish_signup
return unless request.patch? && params[:user]
if @user.update(user_params)
@user.skip_reconfirmation!
bypass_sign_in(@user)
redirect_to root_path, notice: I18n.t('devise.confirmations.send_instructions')
else
@show_errors = true
end
@user.email = current_user.unconfirmed_email || current_user.email if user_signed_in?
end
private