Sha256: ccbe56686fc2d1fb733d898558c89074eb4176a5e60dbadca351a2b1b50828eb

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 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['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.1 lib/omniauth/strategies/threads.rb