X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6a210c4771acb18751e48f7e7c0841eb68469d90..b346f8754f5d4840ad80aa97bd910f3a6844b413:/services/api/app/controllers/application_controller.rb diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index 76b59be6d1..4b13fca1de 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -1,5 +1,6 @@ class ApplicationController < ActionController::Base include CurrentApiClient + include ThemesForRails::ActionController respond_to :json protect_from_forgery @@ -20,6 +21,8 @@ class ApplicationController < ActionController::Base :render_error, :render_not_found] + theme :select_theme + attr_accessor :resource_attrs def index @@ -349,6 +352,9 @@ class ApplicationController < ActionController::Base session[:api_client_authorization_id] = api_client_auth.id user = api_client_auth.user api_client = api_client_auth.api_client + else + # Token seems valid, but points to a non-existent (deleted?) user. + api_client_auth = nil end elsif session[:user_id] user = User.find(session[:user_id]) rescue nil @@ -486,4 +492,8 @@ class ApplicationController < ActionController::Base end super *opts end + + def select_theme + return Rails.configuration.arvados_theme + end end