45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/omniauth/strategies/miicard.rb', line 45
def user_info
@user_info ||= raw_info.nil? ? {} :
{
:name => raw_info['FirstName'] + " " + raw_info['LastName'],
:name_public => raw_info['FirstName'] + " " + raw_info['LastName'],
:first_name => raw_info['FirstName'],
:last_name => raw_info['LastName'],
:phone => (raw_info['PhoneNumbers'].nil? || raw_info['PhoneNumbers'].empty?) ? nil : '+' + raw_info['PhoneNumbers'][0]['CountryCode'] + raw_info['PhoneNumbers'][0]['NationalNumber'],
:email => (raw_info['EmailAddresses'].nil? || raw_info['EmailAddresses'].empty?) ? nil : raw_info['EmailAddresses'][0]['Address'],
:urls => !raw_info['HasPublicProfile'] ? nil : { "Identity assured by miiCard" => raw_info['ProfileUrl'] }
}
end
|