<commit_before>require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Cortex < OmniAuth::Strategies::OAuth2
      option :name, 'cortex'

      option :client_options, {
          :site => 'http://stg.api.cbcortex.com/api/v1',
          :authorize_url => 'http://stg.api.cbcortex.com/oauth/authorize',
          :token_url => 'http://stg.api.cbcortex.com/oauth/access_token'
      }

      uid{ raw_info['id'] }

      info do
        {
            :nickname => raw_info['email'],
            :email => raw_info['email'],
            :name => raw_info['fullname'],
            :first_name => raw_info['firstname'],
            :last_name => raw_info['lastname'],
            :image => raw_info['gravatar']
        }
      end

      extra do
        {:raw_info => raw_info}
      end

      def raw_info
        @raw_info ||= access_token.get('/users/me').parsed
      end
    end
  end
end
<commit_msg>Corrected URLs, less user info transformations<commit_after>require 'omniauth-oauth2'

module OmniAuth
  module Strategies
    class Cortex < OmniAuth::Strategies::OAuth2
      option :name, 'cortex'

      option :client_options, {
        :site          => 'https://cbcortex.com/api/v1',
        :authorize_url => 'https://cbcortex.com/oauth/authorize',
        :token_url     => 'https://cbcortex.com/oauth/token'
      }

      uid{ raw_info['id'] }

      info do
        {
          :email      => raw_info['email'],
          :full_name  => raw_info['fullname'],
          :first_name => raw_info['firstname'],
          :last_name  => raw_info['lastname'],
          :image      => raw_info['gravatar']
        }
      end

      extra do
        { :raw_info => raw_info }
      end

      def raw_info
        @raw_info ||= access_token.get('users/me').parsed
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.13751375137513752, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 2.0066115702479337, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 3, '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': '3810086', 'n_tokens_mistral': 614, 'n_tokens_neox': 592, 'n_words': 103}