lib/omniauth/strategies/prayer_letters.rb in omniauth-prayer-letters-0.0.2 vs lib/omniauth/strategies/prayer_letters.rb in omniauth-prayer-letters-0.0.3
- old
+ new
@@ -1,24 +1,19 @@
-require 'omniauth-oauth'
+require 'omniauth-oauth2'
require 'multi_json'
module OmniAuth
module Strategies
- class PrayerLetters < OmniAuth::Strategies::OAuth
+ class PrayerLetters < OmniAuth::Strategies::OAuth2
option :name, 'prayer_letters'
option :client_options, {
- :site => 'https://www.prayerletters.com',
- :authorize_path => '/my/oauth1/authorize',
- :access_token_path => '/api/oauth1/token',
- :request_token_path => '/api/oauth1/initiate',
- :http_method => 'post',
- :scheme => :query_string
+ site: 'https://www.prayerletters.com',
+ authorize_url: '/my/oauth/authorize',
+ token_url: '/oauth/token'
}
- option :permissions, 'contacts.read,contacts.write'
-
uid { raw_info['id'] }
info do
{
}
@@ -34,10 +29,9 @@
@raw_info ||= {} #MultiJson.decode(access_token.get('/v2/people/@me/@self?format=json').body)['entry']
end
def request_phase
options.request_params ||= {}
- options.request_params[:permissions] = options.permissions
super
end
end
end