Sha256: 27a4d2d41aebdd40ffb055c932e621c31343d97c829ad6d13eb9c2f7abaeb2f2

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class AngelList < OmniAuth::Strategies::OAuth2
      option :client_options, {
        :site => 'https://angel.co/',
        :authorize_url => 'https://angel.co/api/oauth/authorize',
        :token_url => 'https://angel.co/api/oauth/token'
      }

      def request_phase
        super
      end

      uid { raw_ifno['id'] }

      info do
        {
          "name" => raw_ifno["name"],
          "bio" => raw_ifno["bio"],
          "blog_url" => raw_ifno["blog_url"],
          "online_bio_url" => raw_ifno["online_bio_url"],
          "twitter_url" => raw_ifno["twitter_url"],
          "facebook_url" => raw_ifno["facebook_url"],
          "linkedin_url" => raw_ifno["linkedin_url"],
          "follower_count" => raw_ifno["follower_count"],
          "angellist_url" => raw_ifno["angellist_url"],
          "image" => raw_ifno["image"],
          "locations" => raw_ifno["locations"],
          "roles" => raw_ifno["roles"]
        }
      end

      def raw_ifno
        access_token.options[:mode] = :query
        @raw_ifno ||= access_token.get('https://api.angel.co/1/me').parsed
      end
    end
  end
end

OmniAuth.config.add_camelization 'angellist', 'AngelList'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-angellist-0.0.1 lib/omniauth/strategies/angellist.rb