This commit is contained in:
Rory Powell 2023-02-28 13:37:34 +00:00
parent 7ed0586673
commit 7b48c2787e
1 changed files with 2 additions and 4 deletions

View File

@ -139,16 +139,14 @@ async function hasActivatedConfig(ssoConfigs?: SSOConfigs) {
if (!ssoConfigs) {
ssoConfigs = await getSSOConfigs()
}
return !!Object.values(ssoConfigs).find(c => c?.activated)
return !!Object.values(ssoConfigs).find(c => c?.activated)
}
async function verifySettingsConfig(config: SettingsInnerConfig) {
if (config.isSSOEnforced) {
const valid = await hasActivatedConfig()
if (!valid) {
throw new Error(
"Cannot enforce SSO without an activated configuration"
)
throw new Error("Cannot enforce SSO without an activated configuration")
}
}
}