<commit_before>class SessionsController < ApplicationController
  before_action :require_user!, only: [:destroy]
  before_action :require_no_user!, only: [:new, :create]

  def new
    redirect_to new_user_url
  end

  def create
    user = User.find_by_credentials(
      params[:user][:user_name],
      params[:user][:password]
    )

    if user.nil?
      flash.now[:errors] = ["Incorrect username and/or password"]<commit_msg>add error messaging for sign in<commit_after>class SessionsController < ApplicationController
  before_action :require_user!, only: [:destroy]
  before_action :require_no_user!, only: [:new, :create]

  def new
    redirect_to new_user_url
  end

  def create
    user = User.find_by_credentials(
      params[:user][:user_name],
      params[:user][:password]
    )

    if user.nil?
      flash[:errors] = ["Incorrect username and/or password"]
{'fraction_non_alphanumeric': 0.11047835990888383, 'fraction_numerical': 0.0, 'mean_word_length': 4.08092485549133, 'pattern_counts': {'":': 0, '<': 5, '<?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': '510086', 'n_tokens_mistral': 283, 'n_tokens_neox': 269, 'n_words': 64}