<commit_before>class UserSessionsController < ApplicationController
  skip_authorization_check

  def new
  end

  def create
    user = User.authenticate(params[:login], params[:password])
    if user
      if params[:remember_me]
        cookies.permanent[:auth_token] = user.auth_token
      else
        cookies[:auth_token] = user.auth_token
      end
      flash[:notice] = t('c.user_sessions.create')
      redirect_to :root
    else
      flash[:alert] = t('c.user_sessions.failed')
      render :action => :new
    end
  end

  def destroy
    cookies.delete(:auth_token)
    session[:cas_user] = nil
    redirect_to :back, :notice => t('c.user_sessions.destroy')
  end
end<commit_msg>Redirige vers :root après déconnexion sinon problèmes de persmissions<commit_after>class UserSessionsController < ApplicationController
  skip_authorization_check

  def new
  end

  def create
    user = User.authenticate(params[:login], params[:password])
    if user
      if params[:remember_me]
        cookies.permanent[:auth_token] = user.auth_token
      else
        cookies[:auth_token] = user.auth_token
      end
      flash[:notice] = t('c.user_sessions.create')
      redirect_to :root
    else
      flash[:alert] = t('c.user_sessions.failed')
      render :action => :new
    end
  end

  def destroy
    cookies.delete(:auth_token)
    session[:cas_user] = nil
    redirect_to :root, :notice => t('c.user_sessions.destroy')
  end
end
{'fraction_non_alphanumeric': 0.1018005540166205, 'fraction_numerical': 0.0, 'mean_word_length': 3.2128279883381925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6602827', 'n_tokens_mistral': 458, 'n_tokens_neox': 452, 'n_words': 97}