FIX: can't bootstrap with ember-cli when login_required is enabled (#13350)

This commit is contained in:
Neil Lalonde 2021-06-10 09:36:41 -04:00 committed by GitHub
parent e9dc88a7b6
commit a5df693697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,8 @@
class BootstrapController < ApplicationController
include ApplicationHelper
skip_before_action :redirect_to_login_if_required
# This endpoint allows us to produce the data required to start up Discourse via JSON API,
# so that you don't have to scrape the HTML for `data-*` payloads
def index

View File

@ -74,4 +74,11 @@ describe BootstrapController do
bootstrap = json['bootstrap']
expect(bootstrap['extra_locales']).to be_present
end
it "returns data when login_required is enabled" do
SiteSetting.login_required = true
get "/bootstrap.json"
expect(response.status).to eq(200)
expect(response.parsed_body).to be_present
end
end