2015-12-24 10:12:23 +01:00
|
|
|
class FranceConnectParticulierClient < OpenIDConnect::Client
|
2018-01-11 11:07:25 +01:00
|
|
|
def initialize(code = nil)
|
2024-03-05 16:32:18 +01:00
|
|
|
config = FRANCE_CONNECT[:particulier]
|
|
|
|
|
|
|
|
# TODO: remove this block when migration to new domain is done
|
|
|
|
if !Rails.env.test? && Current.host != ENV.fetch("APP_HOST")
|
|
|
|
config[:redirect_uri] = config[:redirect_uri].gsub(ENV.fetch("APP_HOST"), Current.host)
|
|
|
|
end
|
|
|
|
|
|
|
|
super(config)
|
2018-01-11 11:07:25 +01:00
|
|
|
|
|
|
|
if code.present?
|
|
|
|
self.authorization_code = code
|
|
|
|
end
|
2015-12-24 10:12:23 +01:00
|
|
|
end
|
|
|
|
end
|