<commit_before>require 'securerandom'

module UserAuth

  def gen_token(user)
    p "Generating session token for user: " << user[:name]
    st = SecureRandom.hex(16)
    user[:session_token] = st
    user.save()
    return st
  end

  def get_user
    return User.find(:session_token => request.env["HTTP_X_USER_SESSION"])
  end
<commit_msg>clean up debug code<commit_after>require 'securerandom'

module UserAuth

  def gen_token(user)
    st = SecureRandom.hex(16)
    user[:session_token] = st
    user.save()
    return st
  end

  def get_user
    return User.find(:session_token => request.env["HTTP_X_USER_SESSION"])
  end

{'fraction_non_alphanumeric': 0.1045958795562599, 'fraction_numerical': 0.006339144215530904, 'mean_word_length': 3.7518796992481205, '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': '7178069', 'n_tokens_mistral': 221, 'n_tokens_neox': 210, 'n_words': 50}