mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
Remove the access_password site setting
This commit is contained in:
@ -16,7 +16,6 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
before_filter :inject_preview_style
|
||||
before_filter :block_if_maintenance_mode
|
||||
before_filter :check_restricted_access
|
||||
before_filter :authorize_mini_profiler
|
||||
before_filter :store_incoming_links
|
||||
before_filter :preload_json
|
||||
@ -155,9 +154,6 @@ class ApplicationController < ActionController::Base
|
||||
# Don't cache logged in users
|
||||
return false if current_user.present?
|
||||
|
||||
# Don't cache if there's restricted access
|
||||
return false if SiteSetting.access_password.present?
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
@ -236,16 +232,6 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def check_restricted_access
|
||||
# note current_user is defined in the CurrentUser mixin
|
||||
if SiteSetting.access_password.present? && cookies[:_access] != SiteSetting.access_password
|
||||
unless api_key_valid?
|
||||
redirect_to request_access_path(return_path: request.fullpath)
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def mini_profiler_enabled?
|
||||
defined?(Rack::MiniProfiler) && current_user.try(:admin?)
|
||||
end
|
||||
|
Reference in New Issue
Block a user