From b2f1dbd671c9457a20ff3e5586297b28716b98da Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 9 Feb 2023 08:53:30 +0000 Subject: [PATCH] feat: add flash notice for already confirmed --- app/controllers/auth/confirmations_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index 915faf843..d3f617822 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -14,6 +14,7 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController elsif %i[blank invalid].any? { |error| resource.errors.map(&:type).include?(error) } render "devise/confirmations/invalid" elsif resource.errors.map(&:type).include?(:already_confirmed) + flash[:notice] = I18n.t("errors.messages.already_confirmed") redirect_to user_session_path else respond_with_navigational(resource.errors, status: :unprocessable_entity) { render :new }