diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 22d4bd3..b304c6c 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -54,12 +54,5 @@ def empty_cookie secure: !Rails.env.development? && !Rails.env.test?, domain: domain } end - - private - def redirect_options - { - allow_other_host: true - } - end end end diff --git a/config/initializers/devise_allow_other_host.rb b/config/initializers/devise_allow_other_host.rb new file mode 100644 index 0000000..a0f6f74 --- /dev/null +++ b/config/initializers/devise_allow_other_host.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Devise + module Controllers + module Helpers + def redirect_to(options = {}, response_options = {}) + if options.is_a?(String) && options.match?(/\Ahttps?:\/\//) + response_options[:allow_other_host] = true + end + super(options, response_options) + end + end + end +end