<commit_before>include ActionController::HttpAuthentication::Token

module Api
  module V1
    class UsersController < ApplicationController
      before_filter :restrict_access
      protect_from_forgery with: :null_session

      def create_new_session
        binding.pry
        api_key = token_and_options(request)[0]

        if params[:user_id] && params[:username]
          user = User.find_or_create_api_user(
            params[:user_id], 
            params[:username], 
            api_key)

          sign_in(user, store: true)
          binding.pry
          redirect_to campaigns_path
        else
          @error_code = 22
          @error_message = 'User id and username required'

          render 'api/v1/error', formats: [:json], status: 401
        end
      end
    end
  end
end<commit_msg>Remove bindings<commit_after>include ActionController::HttpAuthentication::Token

module Api
  module V1
    class UsersController < ApplicationController
      before_filter :restrict_access
      protect_from_forgery with: :null_session

      def create_new_session
        api_key = token_and_options(request)[0]

        if params[:user_id] && params[:username]
          user = User.find_or_create_api_user(
            params[:user_id], 
            params[:username], 
            api_key)

          sign_in(user, store: true)
          redirect_to campaigns_path
        else
          @error_code = 22
          @error_message = 'User id and username required'

          render 'api/v1/error', formats: [:json], status: 401
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0729559748427673, 'fraction_numerical': 0.010062893081761006, 'mean_word_length': 2.2871900826446283, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2261265', 'n_tokens_mistral': 457, 'n_tokens_neox': 435, 'n_words': 104}