lib/omniauth/strategies/flickr.rb in oa-more-0.2.0 vs lib/omniauth/strategies/flickr.rb in oa-more-0.2.1
- old
+ new
@@ -62,12 +62,21 @@
def auth_hash
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