<commit_before>'use strict'

module.exports = async (_, next) => {
  const id = _.session.userId
  const user = id ? await _.User.find(id) : null
  _.state.currentUser = _.state.client.currentUser = user
  _.state.admin = _.state.client.admin = !!(user && user.isAdmin)
  await next()
}<commit_msg>clean up<commit_after>'use strict'

module.exports = async (_, next) => {
  const {client} = _.state
  const id = _.session.userId
  const user = id ? await _.User.find(id) : null
  _.state.currentUser = client.currentUser = user
  _.state.admin = client.admin = !!(user && user.isAdmin)
  await next()
}
{'fraction_non_alphanumeric': 0.15614617940199335, 'fraction_numerical': 0.0, 'mean_word_length': 3.6030534351145036, 'pattern_counts': {'":': 0, '<': 3, '<?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': '296875', 'n_tokens_mistral': 199, 'n_tokens_neox': 201, 'n_words': 50}