From cbdab52056c3786ca006282d5c753c65be5660d7 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Tue, 22 Oct 2024 13:17:36 -0400 Subject: [PATCH] DEV: restore custom route for custom homepage (#29343) --- app/serializers/auth_provider_serializer.rb | 5 +++++ config/routes.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/serializers/auth_provider_serializer.rb b/app/serializers/auth_provider_serializer.rb index d7bc83afc29..ae8a54e48d8 100644 --- a/app/serializers/auth_provider_serializer.rb +++ b/app/serializers/auth_provider_serializer.rb @@ -20,4 +20,9 @@ class AuthProviderSerializer < ApplicationSerializer return SiteSetting.get(object.pretty_name_setting) if object.pretty_name_setting object.pretty_name end + + def custom_url + # ensures that the "/custom" route doesn't trigger the magic custom_url helper in ActionDispatch + object.custom_url + end end diff --git a/config/routes.rb b/config/routes.rb index 937d9b4e152..cfaec12f630 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1615,6 +1615,8 @@ Discourse::Application.routes.draw do constraints: HomePageConstraint.new("custom"), as: "custom_index" + get "/custom" => "custom_homepage#index" + get "/user-api-key/new" => "user_api_keys#new" post "/user-api-key" => "user_api_keys#create" post "/user-api-key/revoke" => "user_api_keys#revoke"