Fix setting scim config
This commit is contained in:
parent
23088c036e
commit
5e478f2eaa
|
@ -24,7 +24,9 @@
|
||||||
try {
|
try {
|
||||||
await API.saveConfig({
|
await API.saveConfig({
|
||||||
type: configType,
|
type: configType,
|
||||||
enabled: scimEnabled,
|
config: {
|
||||||
|
enabled: scimEnabled,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
notifications.success(`Settings saved`)
|
notifications.success(`Settings saved`)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -58,6 +58,13 @@ function oidcValidation() {
|
||||||
}).unknown(true)
|
}).unknown(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function scimValidation() {
|
||||||
|
// prettier-ignore
|
||||||
|
return Joi.object({
|
||||||
|
enabled: Joi.boolean().required(),
|
||||||
|
}).unknown(true)
|
||||||
|
}
|
||||||
|
|
||||||
function buildConfigSaveValidation() {
|
function buildConfigSaveValidation() {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
return auth.joiValidator.body(Joi.object({
|
return auth.joiValidator.body(Joi.object({
|
||||||
|
@ -74,7 +81,8 @@ function buildConfigSaveValidation() {
|
||||||
{ is: ConfigType.SETTINGS, then: settingValidation() },
|
{ is: ConfigType.SETTINGS, then: settingValidation() },
|
||||||
{ is: ConfigType.ACCOUNT, then: Joi.object().unknown(true) },
|
{ is: ConfigType.ACCOUNT, then: Joi.object().unknown(true) },
|
||||||
{ is: ConfigType.GOOGLE, then: googleValidation() },
|
{ is: ConfigType.GOOGLE, then: googleValidation() },
|
||||||
{ is: ConfigType.OIDC, then: oidcValidation() }
|
{ is: ConfigType.OIDC, then: oidcValidation() },
|
||||||
|
{ is: ConfigType.SCIM, then: scimValidation() }
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
}).required().unknown(true),
|
}).required().unknown(true),
|
||||||
|
|
Loading…
Reference in New Issue