|
1 | | -// import { createRequire } from 'module' |
2 | | -// const require = createRequire(import.meta.url) |
3 | 1 | import express from 'express' |
4 | 2 | import session from 'express-session' |
5 | 3 | import handlebars from 'express-handlebars' |
@@ -89,7 +87,7 @@ function createApp (argv = {}) { |
89 | 87 |
|
90 | 88 | // Serve the public 'common' directory (for shared CSS files, etc) |
91 | 89 | app.use('/common', express.static(path.join(__dirname, '../common'))) |
92 | | - app.use('/', express.static(path.dirname(import.meta.resolve('mashlib/dist/databrowser.html')), { index: false })) |
| 90 | + app.use('/', express.static(path.dirname(fileURLToPath(import.meta.resolve('mashlib/dist/databrowser.html'))), { index: false })) |
93 | 91 | routeResolvedFile(app, '/common/js/', 'solid-auth-client/dist-lib/solid-auth-client.bundle.js') |
94 | 92 | routeResolvedFile(app, '/common/js/', 'solid-auth-client/dist-lib/solid-auth-client.bundle.js.map') |
95 | 93 | app.use('/.well-known', express.static(path.join(__dirname, '../common/well-known'))) |
@@ -331,13 +329,14 @@ function isLogoutRequest (req) { |
331 | 329 | * |
332 | 330 | * @param app {Object} Express.js app instance |
333 | 331 | * @param argv {Object} Config options hashmap |
| 332 | + * @return {Promise} Resolves when authentication initialization is complete |
334 | 333 | */ |
335 | | -function initAuthentication (app, argv) { |
| 334 | +async function initAuthentication (app, argv) { |
336 | 335 | const auth = argv.forceUser ? 'forceUser' : argv.auth |
337 | 336 | if (!(auth in API.authn)) { |
338 | 337 | throw new Error(`Unsupported authentication scheme: ${auth}`) |
339 | 338 | } |
340 | | - API.authn[auth].initialize(app, argv) |
| 339 | + await API.authn[auth].initialize(app, argv) |
341 | 340 | } |
342 | 341 |
|
343 | 342 | /** |
|
0 commit comments