<commit_before>import configureMiddleware from './configure/middleware';
import configurePassport from './configure/passport';
import configureExpress from './configure/express';

let ensureAuthenticated;

export function middleware() {
  if (!ensureAuthenticated) throw 'Security module not configured.  Run configure() first';
  return {ensureAuthenticated};
}

export * from './utils/password';

function configure(app, findUser, findUserById, loginRoute = '/login', logoutRoute = '/logout') {
  ensureAuthenticated = configureMiddleware(loginRoute);
  configurePassport(findUser, findUserById);
  configureExpress(app, loginRoute, logoutRoute);
}

export default configure;
<commit_msg>Added userDetailsExtractor to main configure<commit_after>import configureMiddleware from './configure/middleware';
import configurePassport from './configure/passport';
import configureExpress from './configure/express';

let ensureAuthenticated;

export function middleware() {
  if (!ensureAuthenticated) throw 'Security module not configured.  Run configure() first';
  return {ensureAuthenticated};
}

export * from './utils/password';

function configure(app, findUser, findUserById, userDetailsExtractor, loginRoute = '/login', logoutRoute = '/logout') {
  ensureAuthenticated = configureMiddleware(loginRoute);
  configurePassport(findUser, findUserById);
  configureExpress(app, loginRoute, logoutRoute, userDetailsExtractor);
}

export default configure;

{'fraction_non_alphanumeric': 0.10446735395189004, 'fraction_numerical': 0.0, 'mean_word_length': 6.870270270270271, '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': '1489820', 'n_tokens_mistral': 372, 'n_tokens_neox': 375, 'n_words': 106}