19297: Raises an error only when no object types have the requested attribute.
[arvados.git] / services / api / app / controllers / user_sessions_controller.rb
index 84dfcdbc9b62d25bfdd46f4d2caf9fd4d6b26263..ae34fa76006aabe6c7866cee09d8249f58254567 100644 (file)
@@ -27,7 +27,7 @@ class UserSessionsController < ApplicationController
       authinfo = SafeJSON.load(params[:auth_info])
       max_expires_at = authinfo["expires_at"]
     else
-      # Legacy code path, fail?
+      return send_error "Legacy code path no longer supported", status: 404
     end
 
     if !authinfo['user_uuid'].blank?
@@ -90,14 +90,14 @@ class UserSessionsController < ApplicationController
     flash[:notice] = params[:message]
   end
 
-  # logout - Clear our rack session BUT essentially redirect to the provider
-  # to clean up the Devise session from there too !
+  # logout - this gets intercepted by controller, so this is probably
+  # mostly dead code at this point.
   def logout
     session[:user_id] = nil
 
     flash[:notice] = 'You have logged off'
     return_to = params[:return_to] || root_url
-    redirect_to "#{Rails.configuration.Services.SSO.ExternalURL}users/sign_out?redirect_uri=#{CGI.escape return_to}"
+    redirect_to return_to
   end
 
   # login.  Redirect to LoginCluster.
@@ -132,7 +132,7 @@ class UserSessionsController < ApplicationController
       p << "return_to=#{CGI.escape(params[:return_to])}" if params[:return_to]
       redirect_to "#{login_cluster}/login?#{p.join('&')}"
     else
-      # legacy code path, fail?
+      return send_error "Legacy code path no longer supported", status: 404
     end
   end