Files
speckle-server/packages/server/modules/auth/index.js
T
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00

26 lines
709 B
JavaScript

'use strict'
const { registerOrUpdateScope } = require('@/modules/shared')
const { moduleLogger } = require('@/logging/logging')
exports.init = async (app) => {
moduleLogger.info('🔑 Init auth module')
// Initialize authn strategies
exports.authStrategies = await require('./strategies')(app)
// Hoist auth routes
require('./rest')(app)
// Register core-based scopes
const scopes = require('./scopes.js')
for (const scope of scopes) {
await registerOrUpdateScope(scope)
}
}
exports.finalize = async () => {
// Note: we're registering the default apps last as we want to ensure that all
// scopes have been registered by any other modules.
await require('./defaultApps')()
}