<commit_before>get '/' do
  erb :welcome, layout:false
end

get '/login' do
  erb :'auth/login', layout:false
end

post '/login' do
  user = User.find_by(name: params[:user][:name])

  if user.try(:authenticate, params[:user][:password])
    session[:user_id] = user.id
    redirect "/"
  else
    session[:error] ="Invalid Username or Password."
    redirect "/login"
  end<commit_msg>redirects to profile page after login<commit_after>get '/' do
  erb :welcome, layout:false
end

get '/login' do
  erb :'auth/login', layout:false
end

post '/login' do
  user = User.find_by(name: params[:user][:name])

  if user.try(:authenticate, params[:user][:password])
    session[:user_id] = user.id
    redirect "/user/#{user.id}"
  else
    session[:error] ="Invalid Username or Password."
    redirect "/login"
  end
{'fraction_non_alphanumeric': 0.15659679408138102, 'fraction_numerical': 0.0, 'mean_word_length': 3.951219512195122, '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': '7113590', 'n_tokens_mistral': 285, 'n_tokens_neox': 278, 'n_words': 73}