diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 469c6e060..e131110f5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -31,6 +31,12 @@ class ApplicationController < ActionController::Base # TODO: remove this block when migration to new domain is done # headers['Host'] instead of request.host to keep the port (ex: localhost:3000) Current.host = request.headers['Host'] + + if Current.host.include?("gouv.fr") + Current.application_name = "demarches.gouv.fr" + else + Current.application_name = APPLICATION_NAME + end end def staging_authenticate diff --git a/app/models/current.rb b/app/models/current.rb index e7d4f2a6a..1c27c1973 100644 --- a/app/models/current.rb +++ b/app/models/current.rb @@ -1,3 +1,3 @@ class Current < ActiveSupport::CurrentAttributes - attribute :user, :request_id, :browser, :host + attribute :user, :request_id, :browser, :host, :application_name end