How to use the conf.config.findAccount function in conf

To help you get started, we’ve selected a few conf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github panva / node-oidc-provider / test / test_helper.js View on Github external
return async function () {
    const conf = path.format({ dir, base: `${base}.config.js` });
    let { config, client, clients } = require(conf); // eslint-disable-line

    if (client && !clients) {
      clients = [client];
    }

    if (!config.findAccount) {
      config.findAccount = Account.findAccount;
    }

    const issuerIdentifier = `${protocol}//127.0.0.1:${port}`;

    const provider = new Provider(issuerIdentifier, {
      clients,
      jwks: global.keystore.toJWKS(true),
      adapter: TestAdapter,
      ...config,
    });

    let agent;

    function logout() {
      const expire = new Date(0);
github panva / node-oidc-provider / test / test_helper.js View on Github external
return async function () {
    const conf = path.format({ dir, base: `${base}.config.js` });
    let { config, client, clients } = require(conf); // eslint-disable-line

    if (client && !clients) {
      clients = [client];
    }

    if (!config.findAccount) {
      config.findAccount = Account.findAccount;
    }

    const issuerIdentifier = `${protocol}//127.0.0.1:${port}`;

    const provider = new Provider(issuerIdentifier, {
      clients,
      jwks: global.keystore.toJWKS(true),
      adapter: TestAdapter,
      ...config,
    });

    let agent;

    function logout() {
      const expire = new Date(0);
      const cookies = [