* Sets up authentication-related routes and handlers for the app. * * @param app {Object} Express.js app instance * @param argv {Object} Config options hashmap * @return {Promise} Resolves when authentication initialization is complete
(app, argv)
| 332 | * @return {Promise} Resolves when authentication initialization is complete |
| 333 | */ |
| 334 | async function initAuthentication (app, argv) { |
| 335 | const auth = argv.forceUser ? 'forceUser' : argv.auth |
| 336 | if (!(auth in API.authn)) { |
| 337 | throw new Error(`Unsupported authentication scheme: ${auth}`) |
| 338 | } |
| 339 | await API.authn[auth].initialize(app, argv) |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * Returns a settings object for Express.js sessions. |