<commit_before>const uuid = require('uuid/v4');
const url = require('url');
const _ = require('lodash');
const { InvalidRequest } = require('../helpers/errors');
const instance = require('../helpers/weak_cache');

class SessionNotFound extends InvalidRequest {}

module.exports = function getResumeAction(provider) {
  return async function resumeAction(ctx, next) {
    ctx.oidc.uuid = ctx.params.grant;

    const cookieOptions = _.omit(instance(provider).configuration('cookies.short'), 'maxAge', 'expires');

    const cookieId = ctx.cookies.get(provider.cookieName('resume'), cookieOptions);
    if (!cookieId || cookieId !== ctx.oidc.uuid) {
      throw new SessionNotFound('authorization request has expired');
    }
<commit_msg>fix resume to use exported SessionNotFound<commit_after>const uuid = require('uuid/v4');
const url = require('url');
const _ = require('lodash');
const { SessionNotFound } = require('../helpers/errors');
const instance = require('../helpers/weak_cache');

module.exports = function getResumeAction(provider) {
  return async function resumeAction(ctx, next) {
    ctx.oidc.uuid = ctx.params.grant;

    const cookieOptions = _.omit(instance(provider).configuration('cookies.short'), 'maxAge', 'expires');

    const cookieId = ctx.cookies.get(provider.cookieName('resume'), cookieOptions);
    if (!cookieId || cookieId !== ctx.oidc.uuid) {
      throw new SessionNotFound('authorization request has expired');
    }

{'fraction_non_alphanumeric': 0.1486579490708878, 'fraction_numerical': 0.0013764624913971094, 'mean_word_length': 5.058333333333334, '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': '3058187', 'n_tokens_mistral': 413, 'n_tokens_neox': 405, 'n_words': 95}