FIX: Prevent all kinds of login in readonly mode (#16743)

This commit is contained in:
Daniel Waterworth
2022-05-13 10:52:01 -05:00
committed by GitHub
parent 7412f665e7
commit 66a04c5cfe
3 changed files with 14 additions and 1 deletions

View File

@ -157,6 +157,17 @@ RSpec.describe Users::OmniauthCallbacksController do
end
end
context "in readonly mode" do
use_redis_snapshotting
it "should return a 503" do
Discourse.enable_readonly_mode
get "/auth/google_oauth2/callback"
expect(response.code).to eq("503")
end
end
context "without an `omniauth.auth` env" do
it "should return a 404" do
get "/auth/eviltrout/callback"