Fix setting scim config

This commit is contained in:
adrinr 2023-03-29 09:27:52 +01:00
parent 23088c036e
commit 5e478f2eaa
2 changed files with 12 additions and 2 deletions

View File

@ -24,7 +24,9 @@
try {
await API.saveConfig({
type: configType,
enabled: scimEnabled,
config: {
enabled: scimEnabled,
},
})
notifications.success(`Settings saved`)
} catch (e) {

View File

@ -58,6 +58,13 @@ function oidcValidation() {
}).unknown(true)
}
function scimValidation() {
// prettier-ignore
return Joi.object({
enabled: Joi.boolean().required(),
}).unknown(true)
}
function buildConfigSaveValidation() {
// prettier-ignore
return auth.joiValidator.body(Joi.object({
@ -74,7 +81,8 @@ function buildConfigSaveValidation() {
{ is: ConfigType.SETTINGS, then: settingValidation() },
{ is: ConfigType.ACCOUNT, then: Joi.object().unknown(true) },
{ is: ConfigType.GOOGLE, then: googleValidation() },
{ is: ConfigType.OIDC, then: oidcValidation() }
{ is: ConfigType.OIDC, then: oidcValidation() },
{ is: ConfigType.SCIM, then: scimValidation() }
],
}),
}).required().unknown(true),