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

Passing Gowalla refresh_token and token expiration time through in the auth_hash, so that application can refresh as needed.

This commit is contained in:
Paul Canavese 2011-05-02 15:52:20 -07:00
parent bb64d1f5d0
commit b4c3df1d83

View file

@ -30,6 +30,14 @@ module OmniAuth
@data ||= MultiJson.decode(@access_token.get("/users/me.json"))
end
def refresh_token
@refresh_token ||= @access_token.refresh_token
end
def token_expires_at
@expires_at ||= @access_token.expires_at
end
def request_phase
options[:scope] ||= "read"
super
@ -56,7 +64,7 @@ module OmniAuth
OmniAuth::Utils.deep_merge(super, {
'uid' => user_data["url"].split('/').last,
'user_info' => user_info,
'extra' => {'user_hash' => user_data}
'extra' => {'user_hash' => user_data, 'refresh_token' => refresh_token, 'token_expires_at' => token_expires_at}
})
end
end