app controller: move safe mode from app controller to SessionLoader.

This commit is contained in:
evazion
2019-08-24 22:55:36 -05:00
parent f151285038
commit 1a964f7a10
7 changed files with 55 additions and 48 deletions

View File

@@ -7,7 +7,6 @@ class ApplicationController < ActionController::Base
before_action :normalize_search
before_action :set_started_at_session
before_action :api_check
before_action :set_safe_mode
before_action :set_variant
before_action :track_only_param
layout "default"
@@ -168,6 +167,7 @@ class ApplicationController < ActionController::Base
def reset_current_user
CurrentUser.user = nil
CurrentUser.ip_addr = nil
CurrentUser.safe_mode = false
CurrentUser.root_url = root_url.chomp("/")
end
@@ -211,8 +211,4 @@ class ApplicationController < ActionController::Base
def search_params
params.fetch(:search, {}).permit!
end
def set_safe_mode
CurrentUser.set_safe_mode(request)
end
end