17119: Merge branch 'master' into 17119-add-filter-groups
[arvados.git] / apps / workbench / app / controllers / sessions_controller.rb
index 7967111fff748717a0a47c8a2643c8722007587d..bff0f9f1c96ed8267470c350e24f92d268f5baf5 100644 (file)
@@ -1,11 +1,24 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class SessionsController < ApplicationController
-  skip_around_filter :thread_with_api_token, :only => [:destroy, :index]
-  skip_before_filter :find_object_by_uuid, :only => [:destroy, :index]
+  skip_around_action :require_thread_api_token, :only => [:destroy, :logged_out]
+  skip_around_action :set_thread_api_token, :only => [:destroy, :logged_out]
+  skip_before_action :find_object_by_uuid
+  skip_before_action :find_objects_for_index, raise: false
+  skip_before_action :ensure_arvados_api_exists
+
   def destroy
     session.clear
-    redirect_to $arvados_api_client.arvados_logout_url(return_to: root_url)
+    redirect_to arvados_api_client.arvados_logout_url(return_to: root_url)
   end
-  def index
+
+  def logged_out
     redirect_to root_url if session[:arvados_api_token]
+    render_index
+  end
+
+  def index
   end
 end