<commit_before>get '/signin' do
  erb :'auth/signin'
end

post '/signin' do
  user = User.find(name: params[:name])
  if user & password_valid?(user, params[:password])
    redirect '/'
  else
    redirect '/signin'
  end
end

get '/signup' do
  erb :'auth/signup'
end

post '/signup' do
end
<commit_msg>authentificate user upon signin/signup, also session out upon signout<commit_after>get '/signin' do
  erb :'auth/signin'
end

post '/signin' do
  user = User.find(name: params[:name])

  if user & password_valid?(user, params[:password])
    session_in!(user)

    redirect '/'
  else
    set_error!("Incorrect username and/or password.")
    get_error

    redirect '/signin'
  end
end

get '/signup' do
  erb :'auth/signup'
end

post '/signup' do
  user = User.create(params[:user])
  if user.id
    redirect '/'
  else
    set_error!("Username already exists or passwords do not match.")
    get_error

    redirect '/'
  end
end


get '/signout' do
  session_out!

  redirect '/'
end
{'fraction_non_alphanumeric': 0.1301715438950555, 'fraction_numerical': 0.0, 'mean_word_length': 3.2758620689655173, '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': '6164638', 'n_tokens_mistral': 357, 'n_tokens_neox': 354, 'n_words': 101}