4d01e13a84
* 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>
26 lines
709 B
JavaScript
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')()
|
|
}
|