78ecaeffcb
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)" This reverts commit967329473f. * Revert "Structured logging (attempt 2) (#1234)" This reverts commit444d2ca7dd.
26 lines
693 B
JavaScript
26 lines
693 B
JavaScript
'use strict'
|
|
const debug = require('debug')
|
|
const { registerOrUpdateScope } = require('@/modules/shared')
|
|
|
|
exports.init = async (app) => {
|
|
debug('speckle:modules')('🔑 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')()
|
|
}
|