mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #2710 from urbanrotnik/ur-sci-4568-remove-flash-message
Remove flash message for redirects from root url [SCI-4568]
This commit is contained in:
commit
d6f37ce28e
|
@ -63,6 +63,6 @@
|
|||
})();
|
||||
|
||||
if (SideBarToggle.isToggledStorage()) {
|
||||
SideBarToggle.hide();;
|
||||
SideBarToggle.hide();
|
||||
}
|
||||
})(window);
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
class Users::SessionsController < Devise::SessionsController
|
||||
layout :session_layout
|
||||
|
||||
# before_filter :configure_sign_in_params, only: [:create]
|
||||
after_action :after_sign_in, only: :create
|
||||
before_action :remove_authenticate_mesasge_if_root_path, only: :new
|
||||
|
||||
rescue_from ActionController::InvalidAuthenticityToken do
|
||||
redirect_to new_user_session_path
|
||||
|
@ -75,15 +75,14 @@ class Users::SessionsController < Devise::SessionsController
|
|||
flash[:system_notification_modal] = true
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# If you have extra params to permit, append them to the sanitizer.
|
||||
def configure_sign_in_params
|
||||
devise_parameter_sanitizer.for(:sign_in) << :attribute
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def remove_authenticate_mesasge_if_root_path
|
||||
if session[:user_return_to] == root_path && flash[:alert] == I18n.t('devise.failure.unauthenticated')
|
||||
flash[:alert] = nil
|
||||
end
|
||||
end
|
||||
|
||||
def session_layout
|
||||
if @simple_sign_in
|
||||
'sign_in_halt'
|
||||
|
|
Loading…
Reference in a new issue