<commit_before>module Doorkeeper
  class AuthorizationsController < ::Doorkeeper::ApplicationController
    before_filter :authenticate_resource_owner!

    # TODO: finish skippable authorization
    def new
      if pre_auth.authorizable?
        if Doorkeeper::AccessToken.matching_token_for pre_auth.client, current_resource_owner.id, pre_auth.scopes
          auth = authorization.authorize
          redirect_to auth.redirect_uri
        else
          render :new
        end
      else
        render :error
      end
    end

    def show
    end

    # TODO: Handle raise invalid authorization
    def create
      auth = authorization.authorize

      if auth.redirectable?
        redirect_to auth.redirect_uri
      else
        render :json => auth.body, :status => auth.status
      end
    end<commit_msg>Reminder to move skip authorization to configuration<commit_after>module Doorkeeper
  class AuthorizationsController < ::Doorkeeper::ApplicationController
    before_filter :authenticate_resource_owner!

    def new
      if pre_auth.authorizable?
        # TODO: use configuration (like config.skip_authorization?)
        if Doorkeeper::AccessToken.matching_token_for pre_auth.client, current_resource_owner.id, pre_auth.scopes
          auth = authorization.authorize
          redirect_to auth.redirect_uri
        else
          render :new
        end
      else
        render :error
      end
    end

    def show
    end

    # TODO: Handle raise invalid authorization
    def create
      auth = authorization.authorize

      if auth.redirectable?
        redirect_to auth.redirect_uri
      else
        render :json => auth.body, :status => auth.status
      end
    end
{'fraction_non_alphanumeric': 0.0528169014084507, 'fraction_numerical': 0.0, 'mean_word_length': 2.5010266940451746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6739688', 'n_tokens_mistral': 454, 'n_tokens_neox': 433, 'n_words': 120}