<commit_before>class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  def after_sign_in_path_for(resource)
    user_path(current_user)
  end

  # Stays on the same page after signing out
  def after_sign_out_path_for(resource_or_scope)
    request.referrer
  end
end<commit_msg>Now will correctly return to authenticated page after logging in<commit_after>class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  # Stays on the same page after signing out
  def after_sign_out_path_for(resource_or_scope)
    request.referrer
  end

  # With this when logging in on an unauthenticated page it will redirect you to your own user page
  # When forced to log in because we were sent to an authenticated page it will redirect back to the
  # page after logging in
  def user_root_path
    user_path(current_user) if current_user
  end
end
{'fraction_non_alphanumeric': 0.0398936170212766, 'fraction_numerical': 0.0, 'mean_word_length': 4.534313725490196, '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': '1547776', 'n_tokens_mistral': 328, 'n_tokens_neox': 318, 'n_words': 129}