fix: reload auth strategies when site URL changes

Callback URLs for OAuth/OIDC providers are baked in at strategy
activation. Changing host now reloads them so a restart is not required.
pull/8086/head
Thomas DELORGE 2 days ago
parent 8a979690a7
commit 13216dc537
No known key found for this signature in database
GPG Key ID: A4DACB5302BE0CA0

@ -41,6 +41,7 @@ module.exports = {
SiteMutation: {
async updateConfig(obj, args, context) {
try {
const previousHost = WIKI.config.host
if (args.hasOwnProperty('host')) {
let siteHost = _.trim(args.host)
if (siteHost.endsWith('/')) {
@ -133,6 +134,11 @@ module.exports = {
WIKI.app.disable('trust proxy')
}
if (WIKI.config.host !== previousHost) {
await WIKI.auth.activateStrategies()
WIKI.events.outbound.emit('reloadAuthStrategies')
}
return {
responseResult: graphHelper.generateSuccess('Site configuration updated successfully')
}

Loading…
Cancel
Save