FC service: clean syntax

This commit is contained in:
simon lehericey 2018-01-11 17:07:35 +01:00 committed by Simon Lehericey
parent e68fc0811f
commit 8e26a50f16

View file

@ -8,12 +8,13 @@ class FranceConnectService
nonce: SecureRandom.hex(16))
end
def self.retrieve_user_informations_particulier code
def self.retrieve_user_informations_particulier(code)
client = FranceConnectParticulierClient.new(code)
access_token = client.access_token!(client_auth_method: :secret)
user_info = access_token.userinfo!
hash = Hashie::Mash.new user_info.raw_attributes
hash = Hashie::Mash.new(user_info.raw_attributes)
hash.france_connect_particulier_id = hash.sub
hash