redirect com

This commit is contained in:
Pete Matsyburka
2024-11-02 09:40:17 +02:00
parent 68d3efbdba
commit f669045362
4 changed files with 11 additions and 0 deletions
@@ -104,4 +104,10 @@ class ApplicationController < ActionController::Base
def svg_icon(icon_name, class: '')
render_to_string(partial: "icons/#{icon_name}", locals: { class: })
end
def maybe_redirect_com
return if request.domain != 'docuseal.co'
redirect_to request.url.gsub('.co/', '.com/'), allow_other_host: true, status: :moved_permanently
end
end
+1
View File
@@ -7,6 +7,7 @@ class StartFormController < ApplicationController
skip_authorization_check
around_action :with_browser_locale, only: %i[show completed]
before_action :maybe_redirect_com, only: %i[show completed]
before_action :load_template
def show
@@ -4,6 +4,8 @@ class SubmissionsPreviewController < ApplicationController
skip_before_action :authenticate_user!
skip_authorization_check
before_action :maybe_redirect_com, only: %i[show completed]
TTL = 40.minutes
def show
@@ -7,6 +7,8 @@ class SubmitFormController < ApplicationController
skip_before_action :authenticate_user!
skip_authorization_check
before_action :maybe_redirect_com, only: %i[show completed]
CONFIG_KEYS = [].freeze
def show