diff options
-rw-r--r-- | app/controllers/admin_controller.rb | 1 | ||||
-rw-r--r-- | spec/spec_helper.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 0bfbcd3d1..adb506b91 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -53,6 +53,7 @@ class AdminController < ApplicationController authenticate_or_request_with_http_basic do |user_name, password| if user_name == config_username && password == config_password session[:using_admin] = 1 + request.env['REMOTE_USER'] = user_name else request_http_basic_authentication end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ffe48c731..a486418ce 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -114,7 +114,7 @@ def validate_as_body(html) end def basic_auth_login(request, username = nil, password = nil) - username = MySociety::Config.get('ADMIN_USERNAME') if username.nil? + username = MySociety::Config.get('ADMIN_USERNAME') if username.nil? password = MySociety::Config.get('ADMIN_PASSWORD') if password.nil? request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64::encode64("#{username}:#{password}") end |