<commit_before>require 'omniauth'
require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Ada
      include OmniAuth::Strategy

      option :name, 'ada'

      option :client_options, {
        site: ENV['oauth_url'],
        authorize_url: "#{ENV['oauth_url']}/auth/ada/authorize",
        access_token_url: "#{ENV['oauth_url']}/auth/ada/access_token"
      }

      uid { raw_info['id'] }

      info do
        {
          email: raw_info['email']
        }
      end

      extra do
        {
          'raw_info' => raw_info
        }
      end

      def raw_info
        @raw_info ||= access_token.get("/auth/ada/user.json?oauth_token=#{access_token.token}").parsed
      end

    end
  end
end
<commit_msg>hardcode the oauth_url for now to get things working<commit_after>require 'omniauth'
require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Ada < OmniAuth::Strategies::OAuth2
      puts ENV['oauth_url']

      option :name, 'ada'

      option :client_options, {
        site: "http://localhost:3001",
        authorize_url: "http://localhost:3001/auth/ada/authorize",
        access_token_url: "http://localhost:3001/auth/ada/access_token"
      }

      uid { raw_info['id'] }

      info do
        {
          email: raw_info['email']
        }
      end

      extra do
        {
          'raw_info' => raw_info
        }
      end

      def raw_info
        @raw_info ||= access_token.get("/auth/ada/user.json?oauth_token=#{access_token.token}").parsed
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.11883116883116883, 'fraction_numerical': 0.00974025974025974, 'mean_word_length': 2.1384928716904277, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2244030', 'n_tokens_mistral': 532, 'n_tokens_neox': 508, 'n_words': 95}