diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index ca07f304..d0b4a403 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -31,10 +31,10 @@ class RegistrationsController < Devise::RegistrationsController redirect_to after_sign_up_path_for(current_user), allow_other_host: true end - def require_no_authentication - super + def set_flash_message(key, kind, options = {}) + return if key == :alert && kind == 'already_authenticated' - flash.clear + super end def build_resource(_hash = {}) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 4cfa542e..96379fd9 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -32,9 +32,9 @@ class SessionsController < Devise::SessionsController devise_parameter_sanitizer.permit(:sign_in, keys: [:otp_attempt]) end - def require_no_authentication - super + def set_flash_message(key, kind, options = {}) + return if key == :alert && kind == 'already_authenticated' - flash.clear + super end end