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