<commit_before>class AccountController < ApplicationController

  stylesheet 'account'

  def index
    if logged_in?
      redirect_to me_url
    end
  end

  def login
    return unless request.post?
    self.current_user = User.authenticate(params[:login], params[:password])
    if logged_in?
      if params[:remember_me] == "1"
        self.current_user.remember_me
        cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
      end
      redirect_to params[:redirect] || {:controller => '/me', :action => 'index'}
    else
      flash[:error] = "Username or password is incorrect"
    end
  end

  def signup
    @user = User.new(params[:user])
    return unless request.post?
    @user.save!
    self.current_user = @user
    send_welcome_message(current_user)
    redirect_to params[:redirect] || {:controller => '/account', :action => 'welcome'}
    flash[:notice] = "Thanks for signing up!"
  rescue ActiveRecord::RecordInvalid
    render :action => 'signup'
  end

  def logout
    self.current_user.forget_me if logged_in?
    cookies.delete :auth_token
    reset_session
    flash[:notice] = "You have been logged out."
    redirect_to :controller => '/account', :action => 'index'
  end

  def welcome
    render :text => GreenCloth.new(WELCOME_TEXT_MARKUP).to_html, :layout => 'me'
  end
  <commit_msg>bugfix: new account creation works again<commit_after>class AccountController < ApplicationController

  stylesheet 'account'

  def index
    if logged_in?
      redirect_to me_url
    end
  end

  def login
    return unless request.post?
    self.current_user = User.authenticate(params[:login], params[:password])
    if logged_in?
      if params[:remember_me] == "1"
        self.current_user.remember_me
        cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
      end
      redirect_to params[:redirect] || {:controller => '/me', :action => 'index'}
    else
      flash[:error] = "Username or password is incorrect"
    end
  end

  def signup
    @user = User.new(params[:user])
    return unless request.post?
    @user.save!
    self.current_user = @user
    send_welcome_message(current_user)
    redirect_to params[:redirect] || {:controller => '/account', :action => 'welcome'}
    flash[:notice] = "Thanks for signing up!"
  rescue ActiveRecord::RecordInvalid
    render :action => 'signup'
  end

  def logout
    self.current_user.forget_me if logged_in?
    cookies.delete :auth_token
    reset_session
    flash[:notice] = "You have been logged out."
    redirect_to :controller => '/account', :action => 'index'
  end

  def welcome
    render :text => GreenCloth.new(WELCOME_TEXT_MARKUP).to_html, :layout => 'default'
  end
  
{'fraction_non_alphanumeric': 0.11429582448690728, 'fraction_numerical': 0.0007077140835102619, 'mean_word_length': 3.473101265822785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '4316146', 'n_tokens_mistral': 882, 'n_tokens_neox': 859, 'n_words': 213}