1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

flickr user_info change of schema from username/fullname to nickname/name

This commit is contained in:
Paul Chilton 2011-04-03 16:52:09 +12:00
parent 7b3644fd62
commit 78ae411ea5

View file

@ -64,11 +64,20 @@ module OmniAuth
OmniAuth::Utils.deep_merge(super, {
'uid' => @user['nsid'],
'credentials' => { 'token' => @access_token },
'user_info' => @user,
'user_info' => user_info,
'extra' => { 'user_hash' => @user }
})
end
def user_info
name = @user['fullname']
name = @user['username'] if name.nil? || name.empty?
{
'nickname' => @user['username'],
'name' => name,
}
end
def flickr_sign(params)
Digest::MD5.hexdigest(secret_key + params.sort{|a,b| a[0].to_s <=> b[0].to_s }.flatten.join)
end