<commit_before>import JWT from 'jsonwebtoken';

module.exports = jwtValidate;

function jwtValidate(options) {
  return async function (ctx, next) {
    if (ctx && ctx.header && ctx.header.authorization) {
      const authComponents = ctx.header.authorization.split(' ');
      if (authComponents.length === 2 && authComponents[0] === 'Bearer') {
        const user = await JWT.verify(authComponents[1], options.secret, options.jwtOpts);
        console.log(user);
      }
    }<commit_msg>fix eslint<commit_after>import JWT from 'jsonwebtoken';

module.exports = jwtValidate;

function jwtValidate(options) {
  return async function validate(ctx, next) {
    if (ctx && ctx.header && ctx.header.authorization) {
      const authComponents = ctx.header.authorization.split(' ');
      if (authComponents.length === 2 && authComponents[0] === 'Bearer') {
        const user = await JWT.verify(authComponents[1], options.secret, options.jwtOpts);
        console.log(user);
      }
    }
{'fraction_non_alphanumeric': 0.13807106598984772, 'fraction_numerical': 0.006091370558375634, 'mean_word_length': 3.6952380952380954, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6506759', 'n_tokens_mistral': 300, 'n_tokens_neox': 300, 'n_words': 65}