diff --git a/app/controllers/application_controller/authenticates.rb b/app/controllers/application_controller/authenticates.rb index b4087434b..af92d076e 100644 --- a/app/controllers/application_controller/authenticates.rb +++ b/app/controllers/application_controller/authenticates.rb @@ -27,7 +27,8 @@ module ApplicationController::Authenticates # check if basic_auth fallback is possible if auth_param[:basic_auth_promt] && !user - return request_http_basic_authentication + request_http_basic_authentication + return false end # return auth not ok diff --git a/spec/requests/calendar_subscriptions_spec.rb b/spec/requests/calendar_subscriptions_spec.rb new file mode 100644 index 000000000..5869e164b --- /dev/null +++ b/spec/requests/calendar_subscriptions_spec.rb @@ -0,0 +1,11 @@ +require 'rails_helper' + +RSpec.describe 'iCal endpoints', type: :request do + context 'with no existing session' do + it 'gives HTTP Basic auth prompt (#3064)' do + get '/ical/tickets' + + expect(response.body).to eq("HTTP Basic: Access denied.\n") + end + end +end