A platform for community discussion. Free, open, simple.
FIX: Correct OmniAuth route ordering
David Taylor90108b245095
diff --git a/config/routes.rb b/config/routes.rbindex fb0cda2cf23..88db857f3a7 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -599,9 +599,9 @@ Discourse::Application.routes.draw doendend+ match "/auth/failure", to: "users/omniauth_callbacks#failure", via: [:get, :post]get "/auth/:provider", to: "users/omniauth_callbacks#confirm_request"match "/auth/:provider/callback", to: "users/omniauth_callbacks#complete", via: [:get, :post]- match "/auth/failure", to: "users/omniauth_callbacks#failure", via: [:get, :post]get "/associate/:token", to: "users/associate_accounts#connect_info", constraints: { token: /\h{32}/ }post "/associate/:token", to: "users/associate_accounts#connect", constraints: { token: /\h{32}/ }diff --git a/spec/requests/omniauth_callbacks_controller_spec.rb b/spec/requests/omniauth_callbacks_controller_spec.rbindex 82a424b0bb6..2f4df1be52a 100644--- a/spec/requests/omniauth_callbacks_controller_spec.rb+++ b/spec/requests/omniauth_callbacks_controller_spec.rb@@ -84,6 +84,12 @@ RSpec.describe Users::OmniauthCallbacksController doSiteSetting.enable_google_oauth2_logins = trueend+ it "should display the failure message if needed" do+ get "/auth/failure"+ expect(response.status).to eq(200)+ expect(response.body).to include(I18n.t("login.omniauth_error"))+ end+describe "request" doit "should error for non existant authenticators" dopost "/auth/fake_auth"