<commit_before>class ApplicationController < ActionController::Base
  before_action :configure_permitted_parameters, if: :devise_controller?
  protect_from_forgery
  before_filter :set_mailer_host
  helper :all

  def user_root_path
    if current_user.on_a_team?
      team_path(current_user.team_id)
    else
      join_team_users_path
    end
  end

  def set_mailer_host
    ActionMailer::Base.default_url_options[:host] = request.host_with_port
  end

  private

  def configure_permitted_parameters # Be sure to update this in the confirmations controller as well if you need to add parameters.
    devise_parameter_sanitizer.permit(:sign_up, keys: [:full_name, :affiliation, :year_in_school, :state, :compete_for_prizes, :gender, :age, :area_of_study])
    devise_parameter_sanitizer.permit(:account_update, keys: [:full_name, :affiliation, :year_in_school, :state, :compete_for_prizes, :gender, :age, :area_of_study])
  end
end<commit_msg>Brakeman identified issue, protect_from_forgery should kick an exception.<commit_after>class ApplicationController < ActionController::Base
  before_action :configure_permitted_parameters, if: :devise_controller?
  protect_from_forgery with: :exception
  before_filter :set_mailer_host
  helper :all

  def user_root_path
    if current_user.on_a_team?
      team_path(current_user.team_id)
    else
      join_team_users_path
    end
  end

  def set_mailer_host
    ActionMailer::Base.default_url_options[:host] = request.host_with_port
  end

  private

  def configure_permitted_parameters # Be sure to update this in the confirmations controller as well if you need to add parameters.
    devise_parameter_sanitizer.permit(:sign_up, keys: [:full_name, :affiliation, :year_in_school, :state, :compete_for_prizes, :gender, :age, :area_of_study])
    devise_parameter_sanitizer.permit(:account_update, keys: [:full_name, :affiliation, :year_in_school, :state, :compete_for_prizes, :gender, :age, :area_of_study])
  end
end
{'fraction_non_alphanumeric': 0.07711821410451547, 'fraction_numerical': 0.0, 'mean_word_length': 5.823529411764706, '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': '7474535', 'n_tokens_mistral': 660, 'n_tokens_neox': 643, 'n_words': 144}