<commit_before>class ApplicationController < ActionController::Base
  protect_from_forgery

  rescue_from CanCan::AccessDenied do |exception|
    redirect_to products_path, :alert => exception.message
  end

  private

  def authenticate!
    if current_user.present?
      return true
    else
      redirect_to new_session_path
      return false
    end
  end<commit_msg>Make it so that failed auth notifies user.<commit_after>class ApplicationController < ActionController::Base
  protect_from_forgery

  rescue_from CanCan::AccessDenied do |exception|
    redirect_to products_path, :alert => exception.message
  end

  private

  def authenticate!
    if current_user.present?
      return true
    else
      flash[:error] = "You need to be logged in to access that!"
      redirect_to new_session_path
      return false
    end
  end
{'fraction_non_alphanumeric': 0.052256532066508314, 'fraction_numerical': 0.0, 'mean_word_length': 3.5815217391304346, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3387492', 'n_tokens_mistral': 239, 'n_tokens_neox': 232, 'n_words': 70}