<commit_before>Doorkeeper.configure do
  orm :active_record
  # This block will be called to check whether the
  # resource owner is authenticated or not
  resource_owner_authenticator do |routes|
    # Put your resource owner authentication logic here.
    # If you want to use named routes from your app you need
    # to call them on routes object eg.
    # routes.new_user_session_path
    #Participant.find_by(id: session[:current_participant_id]) || redirect_to(login_url)
    if participant_signed_in?
      current_participant
    else 
      redirect_to root_path
    end
  end

  # If you want to restrict the access to the web interface for
  # adding oauth authorized applications you need to declare the
  # block below
  # admin_authenticator do |routes|
  #   # Put your admin authentication logic here.
  #   # If you want to use named routes from your app you need
  #   # to call them on routes object eg.
  #   # routes.new_admin_session_path
  #   Admin.find_by_id(session[:admin_id]) || redirect_to routes.new_admin_session_path
  # end

  #resource_owner_from_credentials do
  #   request.params[:participant] = {:email => request.params[:name], :password => request.params[:password]}
  #   request.env["devise.allow_params_authentication"] = true
  #   user = request.env["warden"].authenticate!(:scope => :participant)
  #   env['warden'].logout
  #   participant
  #end

  # Access token expiration time (default 2 hours)
  access_token_expires_in 2.hours
  #access_token_expires_in 1.minutes

  # Issue access tokens with refresh token (disabled by default)
  use_refresh_token

  # Define access token scopes for your provider
  # For more information go to https://github.com/applicake/doorkeeper/wiki/Using-Scopes
  default_scopes  :public
  optional_scopes :write
end
<commit_msg>change redirect<commit_after>Doorkeeper.configure do
  orm :active_record
  # This block will be called to check whether the
  # resource owner is authenticated or not
  resource_owner_authenticator do |routes|
    Participant.find_by_id(id: session[:participant_id]) || redirect_to(new_session_url(return_to: request.fullpath))
    #if participant_signed_in?
    #  current_participant
    #else 
    #  redirect_to root_path
    #end
  end

  # If you want to restrict the access to the web interface for
  # adding oauth authorized applications you need to declare the
  # block below
  # admin_authenticator do |routes|
  #   # Put your admin authentication logic here.
  #   # If you want to use named routes from your app you need
  #   # to call them on routes object eg.
  #   # routes.new_admin_session_path
  #   Admin.find_by_id(session[:admin_id]) || redirect_to routes.new_admin_session_path
  # end

  #resource_owner_from_credentials do
  #   request.params[:participant] = {:email => request.params[:name], :password => request.params[:password]}
  #   request.env["devise.allow_params_authentication"] = true
  #   user = request.env["warden"].authenticate!(:scope => :participant)
  #   env['warden'].logout
  #   participant
  #end

  # Access token expiration time (default 2 hours)
  access_token_expires_in 2.hours
  #access_token_expires_in 1.minutes

  # Issue access tokens with refresh token (disabled by default)
  use_refresh_token

  # Define access token scopes for your provider
  # For more information go to https://github.com/applicake/doorkeeper/wiki/Using-Scopes
  default_scopes  :public
  optional_scopes :write
end

{'fraction_non_alphanumeric': 0.07763347763347764, 'fraction_numerical': 0.0017316017316017316, 'mean_word_length': 4.023188405797101, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '5428946', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1021, 'n_words': 315}