set Current.application_name

This commit is contained in:
simon lehericey 2024-03-19 21:41:45 +01:00
parent 5c06430042
commit b9fcb25f1a
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -1,3 +1,3 @@
class Current < ActiveSupport::CurrentAttributes
attribute :user, :request_id, :browser, :host
attribute :user, :request_id, :browser, :host, :application_name
end