b84b24467d
* feat: make automate app registration optional based on the existence of the url config * docs: add back automate env var with docs * feat: app redirect url application side override * chore: cleanup
26 lines
715 B
JavaScript
26 lines
715 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('./manageDefaultApps')()
|
|
}
|