<commit_before>class SessionsController < ApplicationController
  def new
    @user = User.new
  end

  def create
    @user = User.find_by(email: session_params[:email])
    .try(:authenticate, session_params[:password])
    if @user
      session[:user_id] = @user.id
      redirect_to '/'
    else
      flash[:error] = "Login Failed"
      redirect_to login_path
    end
  end

  def destroy
    session.clear
    redirect_to login_path
  end

  private

  def session_params
    params.require(:session).permit(:email, :password)
  end
end<commit_msg>Redirect login to my_events instead of '/'<commit_after>class SessionsController < ApplicationController
  def new
    @user = User.new
  end

  def create
    @user = User.find_by(email: session_params[:email])
    .try(:authenticate, session_params[:password])
    if @user
      session[:user_id] = @user.id
      redirect_to my_events_path
    else
      flash[:error] = "Login Failed"
      redirect_to login_path
    end
  end

  def destroy
    session.clear
    redirect_to login_path
  end

  private

  def session_params
    params.require(:session).permit(:email, :password)
  end
end
{'fraction_non_alphanumeric': 0.08854166666666667, 'fraction_numerical': 0.0, 'mean_word_length': 3.132616487455197, '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': '3296795', 'n_tokens_mistral': 365, 'n_tokens_neox': 350, 'n_words': 88}