X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8e69317214ad56a6255f56725fa3b966c663eda3..2ed4ec45553b9931f78ca88b694f590102ed2bbd:/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