Sha256: 1290730e1a1fad01307272fcac2c5f7739e9794dcd5a25790c62eb8ce5bae640

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

require 'omniauth-oauth2'
require 'multi_json'

module OmniAuth
  module Strategies
    class PrayerLetters < OmniAuth::Strategies::OAuth2
      option :name, 'prayer_letters'

      option :client_options, {
        site: 'https://www.prayerletters.com',
        authorize_url: '/my/oauth/authorize',
        token_url: '/oauth/token'
      }

      uid { raw_info['id'] }

      info do
        {
        }
      end

      extra do
        {
          'raw_info' => raw_info
        }
      end

      def raw_info
        @raw_info ||= {} #MultiJson.decode(access_token.get('/v2/people/@me/@self?format=json').body)['entry']
      end

      def request_phase
        options.request_params ||= {}
        super
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-prayer-letters-0.0.3 lib/omniauth/strategies/prayer_letters.rb