<commit_before>module Oauth
  module Controllers
    module ConsumerController
      def self.included(controller)
        controller.class_eval do  
          before_filter :login_required
          before_filter :load_consumer
          skip_before_filter :verify_authenticity_token
        end
      end
      
      # creates request token and redirects on to oauth provider's auth page
      # If user is already connected it displays a page with an option to disconnect and redo
      def show
        unless @token
          @request_token=@consumer.get_request_token(callback_oauth_consumer_url(params[:id]))
          session[@request_token.token]=@request_token.secret
          redirect_to @request_token.authorize_url
        end
      end

      def callback
        @request_token_secret=session[params[:oauth_token]]
        if @request_token_secret
          @token=@consumer.create_from_request_token(current_user,params[:oauth_token],@request_token_secret,params[:oauth_verifier])<commit_msg>OAuth 1.0 support on consumer side<commit_after>module Oauth
  module Controllers
    module ConsumerController
      def self.included(controller)
        controller.class_eval do  
          before_filter :login_required
          before_filter :load_consumer
          skip_before_filter :verify_authenticity_token
        end
      end
      
      # creates request token and redirects on to oauth provider's auth page
      # If user is already connected it displays a page with an option to disconnect and redo
      def show
        unless @token
          @request_token=@consumer.get_request_token(callback_oauth_consumer_url(params[:id]))
          session[@request_token.token]=@request_token.secret
          if @request_token.callback_confirmed?
            redirect_to @request_token.authorize_url
          else
            redirect_to(@request_token.authorize_url + "&oauth_callback=#{callback_oauth_consumer_url(params[:id])}")
          end
        end
      end

      def callback
        @request_token_secret=session[params[:oauth_token]]
        if @request_token_secret
          @token=@consumer.create_from_request_token(current_user,params[:oauth_token],@request_token_secret,params[:oauth_verifier])
{'fraction_non_alphanumeric': 0.0612153708668454, 'fraction_numerical': 0.0008936550491510277, 'mean_word_length': 3.070909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6710011', 'n_tokens_mistral': 613, 'n_tokens_neox': 592, 'n_words': 132}