Remove SessionCookieUpgrader from middleware

This was a transitional bit of code to allow us to rename our session cookies without killing active sessions and logging users out. It's done it's job, the transition is finished, and it isn't doing anything useful now. It can be removed from the middleware stack.
This commit is contained in:
Matt-Yorkley
2023-04-28 14:01:15 +01:00
parent 152af5e105
commit 84df1bfeab

View File

@@ -34,15 +34,6 @@ end
module Openfoodnetwork
class Application < Rails::Application
config.middleware.insert_before(
ActionDispatch::Cookies,
SessionCookieUpgrader, {
old_key: "_session_id",
new_key: "_ofn_session_id",
domain: ".#{ENV['SITE_URL'].gsub(/^(www\.)|^(app\.)|^(staging\.)|^(stg\.)/, '')}"
}
) if Rails.env.staging? || Rails.env.production?
config.after_initialize do
# We need this here because the test env file loads before the Spree engine is loaded
Spree::Core::Engine.routes.default_url_options[:host] = ENV["SITE_URL"] if Rails.env == 'test'