<commit_before>class CustomFailure < Devise::FailureApp
  def redirect_url
    # Ensure both /admin and /admin/ redirect to sign in page
    regexp = Regexp.new("#{admin_root_path}(\/)?")

    if request.original_url.match(regexp)
      new_user_session_path
    else
      root_path
    end
  end

  def respond
    if http_auth?
      http_auth
    else
      redirect
    end
  end
end
<commit_msg>Do not need the optional '/' to be specified<commit_after>class CustomFailure < Devise::FailureApp
  def redirect_url
    # Ensure both /admin and /admin/ redirect to sign in page
    if request.original_url.match(admin_root_path)
      new_user_session_path
    else
      root_path
    end
  end

  def respond
    if http_auth?
      http_auth
    else
      redirect
    end
  end
end

{'fraction_non_alphanumeric': 0.05949367088607595, 'fraction_numerical': 0.0, 'mean_word_length': 2.579185520361991, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4095955', 'n_tokens_mistral': 251, 'n_tokens_neox': 249, 'n_words': 73}