diff --git a/app/controllers/password_resets_controller.rb b/app/controllers/password_resets_controller.rb index 4e84024c..caf978ef 100644 --- a/app/controllers/password_resets_controller.rb +++ b/app/controllers/password_resets_controller.rb @@ -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}" diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dc638764..904ef56d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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"))