diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8475af7..3d657e9 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -49,7 +49,12 @@ end def after_sign_in_path_for(resource) - session[:previous_url] || root_path + # request.referer, identifies the URL that linked to the resource being requested + if request.referer.eql?(new_user_session_path) + root_path + else + request.referer || root_path + end end def after_sign_up_path_for(resource) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index f920923..0c9730d 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,8 @@ class SessionsController < Devise::SessionsController - + + def new + redirect_to(root_path) + end # Capture the user's shibboleth id if they're coming in from an IDP # --------------------------------------------------------------------- def create