Function importOidcProvider

  • Import the OIDC-provider package.

    As oidc-provider is an ESM package and CSS is CJS, we have to use a dynamic import here. Unfortunately, there is a Node/Jest bug that causes segmentation faults when doing such an import in Jest: To work around that, we do the import differently, in case we are in a Jest test run. This can be detected via the env variables: There have been reports of JEST_WORKER_ID being undefined, so to be sure we check both.

    Returns CanBePromise<__module>