From b6d350ebbd5286f7d06633a88f1bc3a866eec7bb Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Wed, 18 Oct 2023 22:56:28 +0300 Subject: [PATCH] fix no error messages when sign in with wrong credentials --- app/controllers/registrations_controller.rb | 6 +++--- app/controllers/sessions_controller.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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