Sha256: 545762cafcbd18a57b1d58be58f30b60780ff0da2c01fe7be1d0cfce983ae7e9

Contents?: true

Size: 846 Bytes

Versions: 1

Compression:

Stored size: 846 Bytes

Contents

require 'omniauth-oauth2'


module OmniAuth
  module Strategies
    class Threads < OmniAuth::Strategies::OAuth2
      option :name, "threads"

      option :client_options, {
        site: "https://graph.threads.net/",
        authorize_url: "https://threads.net/oauth/authorize",
        token_url: 'oauth/access_token'
      }

      def token_params
        super.tap do |params|
          params.client_secret = options.client_secret
          params.client_id = options.client_id
        end
      end

      def callback_url
        super.split("?").first
      end



      uid { raw_info['user_id'] }

      info do
        {}
      end

      extra do
        {
          'raw_info' => raw_info
        }
      end

      def raw_info
        {}
        # @raw_info ||= access_token.get('/me').parsed
      end
      
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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