<commit_before>class SessionsController < ApplicationController
  def new
  end

  def create
    user = User.from_omniauth(env["omniauth.auth"])

    session[:user_id] = user.id
    redirect_to root_url, :notice => "Signed in!"
  end

  def destroy
    session[:user_id] = nil
    redirect_to root_url, :notice => "Signed out!"
  end

protected

  def auth_hash
    request.env['omniauth.auth']
  end
end
<commit_msg>making sessions controller respond with son<commit_after>class SessionsController < ApplicationController
  respond_to :json, :html

  def new
  end

  def create
    user = User.from_omniauth(env["omniauth.auth"])

    session[:user_id] = user.id
    respond_to do |format|
      format.json{render json: current_user}
      format.html{redirect_to root_url, :notice => "Signed in!"}
    end
  end

  def destroy
    session[:user_id] = nil
    sign_out(current_user)

    respond_to do |format|
      format.json {render json: {notice: "Signed out!"}, status: 200}
      format.html {redirect_to root_url, :notice => "Signed out!"}
    end
  end

protected

  def auth_hash
    request.env['omniauth.auth']
  end
end

{'fraction_non_alphanumeric': 0.1011433597185576, 'fraction_numerical': 0.002638522427440633, 'mean_word_length': 3.4803149606299213, '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': '395526', 'n_tokens_mistral': 386, 'n_tokens_neox': 364, 'n_words': 97}