diff --git a/lib/omniauth-podio/version.rb b/lib/omniauth-podio/version.rb index f319f80..89ac528 100644 --- a/lib/omniauth-podio/version.rb +++ b/lib/omniauth-podio/version.rb @@ -1,5 +1,5 @@ module Omniauth module Podio - VERSION = "0.0.1alpha" + VERSION = "0.0.1" end end diff --git a/lib/omniauth/strategies/podio.rb b/lib/omniauth/strategies/podio.rb index 17d11da..3a338d6 100644 --- a/lib/omniauth/strategies/podio.rb +++ b/lib/omniauth/strategies/podio.rb @@ -4,14 +4,30 @@ module OmniAuth module Strategies class Podio < OmniAuth::Strategies::OAuth2 option :client_options, { - :site => 'https://api.podio.com/', - :authorize_url => 'https://podio.com/oauth/authorize' - } - + :site => 'https://api.podio.com/', + :authorize_url => 'https://podio.com/oauth/authorize', + :token_url => "https://podio.com/oauth/token" + } + def request_phase super end + info do + { + :email => raw_info["mail"], + :user_id => raw_info["user_id"] + + } + end + + extra do + {:raw_info => raw_info} + end + + def raw_info + @raw_info ||= MultiJson.decode(access_token.get('/user').body) + end end end end