<commit_before>get '/login' do
  @user = User.new
  erb :"sessions/login_form"
end

post '/login' do
  if user = User.authenticate(params[:sessions])
    session[:user_id] = user.id
    redirect "/users/#{user.id}"
  else
    @user = User.new(params[:sessions])
    @errors = ["Bad username - password combination"]
    erb :"sessions/login_form"
  end
end

get '/logout' do
  session[:user_id] = nil
  redirect "/"
end

get '/signup' do
  @user = User.new
  erb :"sessions/signup_form"
end

post '/signup' do
  @user = User.new(params[:sessions])
  if @user.save
    session[:user_id] = @user.id
    redirect "/users/#{user.id}"
  else
    @errors = @user.errors.full_messages
    erb :"sessions/signup_form"
  end
end
<commit_msg>Make user instance variable in controller<commit_after>get '/login' do
  @user = User.new
  erb :"sessions/login_form"
end

post '/login' do
  if @user = User.authenticate(params[:sessions])
    session[:user_id] = user.id
    redirect "/users/#{@user.id}"
  else
    @user = User.new(params[:sessions])
    @errors = ["Bad username - password combination"]
    erb :"sessions/login_form"
  end
end

get '/logout' do
  session[:user_id] = nil
  redirect "/"
end

get '/signup' do
  @user = User.new
  erb :"sessions/signup_form"
end

post '/signup' do
  @user = User.new(params[:sessions])
  if @user.save
    session[:user_id] = @user.id
    redirect "/users/#{@user.id}"
  else
    @errors = @user.errors.full_messages
    erb :"sessions/signup_form"
  end
end

{'fraction_non_alphanumeric': 0.1505016722408027, 'fraction_numerical': 0.0, 'mean_word_length': 3.374269005847953, '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': '894900', 'n_tokens_mistral': 559, 'n_tokens_neox': 556, 'n_words': 131}