Fix issue with flash messages and activation link (#454)

This commit is contained in:
farhatahmad 2019-04-11 14:31:45 -04:00 committed by Jesus Federico
parent c595ba9895
commit 6bd5d81697
2 changed files with 5 additions and 3 deletions

View File

@ -30,9 +30,11 @@ class PasswordResetsController < ApplicationController
if @user
@user.create_reset_digest
@user.send_password_reset_email(reset_link)
redirect_to root_url, notice: I18n.t("email_sent")
flash[:success] = I18n.t("email_sent")
redirect_to root_path
else
redirect_to new_password_reset_path, alert: I18n.t("no_user_email_exists")
flash[:alert] = I18n.t("no_user_email_exists")
redirect_to new_password_reset_path
end
rescue => e
logger.error "Error in email delivery: #{e}"

View File

@ -39,7 +39,7 @@ class UsersController < ApplicationController
# Start email verification and redirect to root.
begin
@user.send_activation_email(verification_link)
@user.send_activation_email(user_verification_link)
rescue => e
logger.error "Error in email delivery: #{e}"
flash[:alert] = I18n.t(params[:message], default: I18n.t("delivery_error"))