Sha256: 55e720a8ff04e87b90815bfe862e85698e380851c8eee64210b8ecb463c290ce

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Timetree < OmniAuth::Strategies::OAuth2
      option :name, 'timetree'
      option :client_options, site: 'https://timetreeapp.com',
                              authorize_url: '/oauth/authorize',
                              token_url: '/oauth/token'

      uid { raw_info[:id] }

      extra do
        { raw_info: raw_info }
      end

      def raw_info
        @raw_info ||= access_token.get('/user').parsed['data'] || {}
      end

      def callback_url
        full_host + script_name + callback_path
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-timetree-0.1.0 lib/omniauth/strategies/timetree.rb