Sha256: 0be1adebfa728654df2bf00c7b84879506839cc0260db22934ee059ccb8aeede
Contents?: true
Size: 801 Bytes
Versions: 1
Compression:
Stored size: 801 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' uid { raw_info[:id] } extra do {:raw_info => raw_info} end def raw_info return @raw_info unless @raw_info.nil? endpoint = 'https://timetreeapis.com/user' options = {:headers => {'Accept' => 'application/vnd.timetree.v1+json'}} res = access_token.get(endpoint, options) parsed_body = JSON.parse(res.body, :symbolize_names => true) @raw_info = parsed_body[: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.4 | lib/omniauth/strategies/timetree.rb |