adjusted SSOSettings model and changed all code based on the model

This commit is contained in:
David Leimroth 2022-02-10 14:45:21 +01:00
parent b12a38d12b
commit 3cd09eecba
9 changed files with 251 additions and 103 deletions

View file

@ -297,18 +297,20 @@ class ApiController {
return res.sendStatus(403)
}
let SSOUpdate = req.body
Logger.debug("SSOUpdate=", SSOUpdate)
if (!SSOUpdate || !isObject(SSOUpdate)) {
return res.status(500).send('Invalid settings update object')
}
console.log("SSOUpdate", JSON.stringify(SSOUpdate))
var madeUpdates = this.db.SSOSettings.update(SSOUpdate)
console.log("SSOUpdate", JSON.stringify(this.db.SSOSettings))
if (madeUpdates) {
await this.db.updateEntity('sso', this.db.SSOUpdate)
await this.db.updateEntity('settings', this.db.SSOSettings)
}
return res.json({
success: true,
SSOUpdate: this.db.SSOUpdate
SSOUpdate: this.db.SSOSettings
})
}