<commit_before>import Router from 'koa-router'
import passport from 'koa-passport'
import jwt from 'jsonwebtoken'
import config from '../../config/config'

const router = new Router({ prefix: '/auth' })

router.post('/', async (ctx, next) =>
  passport.authenticate('local', (user) => {
    if (!user) {
      ctx.throw(401)
    }

    const token = jwt.sign({ id: user.id }, config.tokenSecret)

    const response = user.toJSON()

    delete response.password
    delete response.salt

    ctx.body = {
      token,
      user: response
    }
  })(ctx, next)
)

export default router<commit_msg>Fix token name<commit_after>import Router from 'koa-router'
import passport from 'koa-passport'
import jwt from 'jsonwebtoken'
import config from '../../config/config'

const router = new Router({ prefix: '/auth' })

router.post('/', async (ctx, next) =>
  passport.authenticate('local', (user) => {
    if (!user) {
      ctx.throw(401)
    }

    const token = jwt.sign({ id: user.id }, config.token)

    const response = user.toJSON()

    delete response.password
    delete response.salt

    ctx.body = {
      token,
      user: response
    }
  })(ctx, next)
)

export default router
{'fraction_non_alphanumeric': 0.14465937762825903, 'fraction_numerical': 0.005046257359125316, 'mean_word_length': 2.979933110367893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2064228', 'n_tokens_mistral': 396, 'n_tokens_neox': 377, 'n_words': 107}