<commit_before>class UsersController < ApplicationController

  def new
    @group = Group.find(params[:group_id])
    @user = User.new
    render :new
  end

  #this is for when mike creates a new user with just an email
  def create
    @user = User.new(user_params)
    @user.add_token
    @tempass = <PASSWORD>.<PASSWORD>(4)
    @user.password = <PASSWORD>
    @group = Group.find(params[:group_id])
    if @user.save
      Reviewer.create(user: @user, group: @group)
      UserMailer.invite_mailer(@user, @tempass).deliver
      redirect '/'
    else
      render :new
    end
  end

  def show
    @reviews = Review.find_by(user_id: params[:id])
  end

  def set_password
    @user.find_by(email: params[:email])
    if params[:token] == @user.token
      @user.password = params[:password]
      @user.save
      redirect_to login_path
    else
      redirect_to root_path
    end
  end

  private
  def user_params
    params.require(:user).permit(:email)
  end<commit_msg>Fix redirect path<commit_after>class UsersController < ApplicationController

  def new
    @group = Group.find(params[:group_id])
    @user = User.new
    render :new
  end

  #this is for when mike creates a new user with just an email
  def create
    @user = User.new(user_params)
    @user.add_token
    @tempass = <PASSWORD>.<PASSWORD>(4)
    @user.password = <PASSWORD>
    @group = Group.find(params[:group_id])
    if @user.save
      Reviewer.create(user: @user, group: @group)
      UserMailer.invite_mailer(@user, @tempass).deliver
      redirect_to '/'
    else
      render :new
    end
  end

  def show
    @reviews = Review.find_by(user_id: params[:id])
  end

  def set_password
    @user.find_by(email: params[:email])
    if params[:token] == @user.token
      @user.password = params[:password]
      @user.save
      redirect_to login_path
    else
      redirect_to root_path
    end
  end

  private
  def user_params
    params.require(:user).permit(:email)
  end
{'fraction_non_alphanumeric': 0.10868461147790756, 'fraction_numerical': 0.001015744032503809, 'mean_word_length': 2.88560157790927, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '505175', 'n_tokens_mistral': 661, 'n_tokens_neox': 648, 'n_words': 157}