<commit_before>class AccountsController < ApplicationController

  before_filter :verify_users, :only => [:login]

  def login
    case request.method
      when :post
      if session[:user] = User.authenticate(params[:user_login], params[:user_password])

        flash[:notice]  = "Login successful"
        cookies[:is_admin] = "yes"
        redirect_back_or_default :controller => "admin/content", :action => "index"
      else
        flash.now['notice']  = "Login unsuccessful"

        @login = params[:user_login]
      end
    end
  end

  def signup
    redirect_to :action => "login" and return unless User.count.zero?

    @user = User.new(params[:user])

    if request.post? and @user.save
      session[:user] = User.authenticate(@user.login, params[:user][:password])<commit_msg>Fix #813 - flash[] should be given a symbol, not a string<commit_after>class AccountsController < ApplicationController

  before_filter :verify_users, :only => [:login]

  def login
    case request.method
      when :post
      if session[:user] = User.authenticate(params[:user_login], params[:user_password])

        flash[:notice]  = "Login successful"
        cookies[:is_admin] = "yes"
        redirect_back_or_default :controller => "admin/content", :action => "index"
      else
        flash.now[:notice]  = "Login unsuccessful"

        @login = params[:user_login]
      end
    end
  end

  def signup
    redirect_to :action => "login" and return unless User.count.zero?

    @user = User.new(params[:user])

    if request.post? and @user.save
      session[:user] = User.authenticate(@user.login, params[:user][:password])
{'fraction_non_alphanumeric': 0.12599388379204893, 'fraction_numerical': 0.001834862385321101, 'mean_word_length': 3.316622691292876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7542538', 'n_tokens_mistral': 495, 'n_tokens_neox': 474, 'n_words': 117}