Mark google activated by default for old configs

This commit is contained in:
Rory Powell 2021-07-23 14:40:22 +01:00
parent af28a7ed6b
commit b5c12e6265
1 changed files with 16 additions and 6 deletions

View File

@ -150,14 +150,24 @@ exports.publicSettings = async function (ctx) {
} }
// google button flag // google button flag
const googleActivated = if (googleConfig && googleConfig.config) {
googleConfig.config.activated == undefined || // activated by default for configs pre-activated flag const googleActivated =
googleConfig.config.activated googleConfig.config.activated == undefined || // activated by default for configs pre-activated flag
config.config.google = !googleConfig ? false : googleActivated googleConfig.config.activated
config.config.google = googleActivated
} else {
config.config.google = false
}
// oidc button flag // oidc button flag
const oidcActivated = !oidcConfig.config.configs[0].activated if (oidcConfig && oidcConfig.config) {
config.config.oidc = !oidcConfig ? false : oidcActivated const oidcActivated = oidcConfig.config.configs[0].activated
config.config.oidc = oidcActivated
} else {
config.config.oidc = false
}
ctx.body = config ctx.body = config
} catch (err) { } catch (err) {