Browse Source
Merge pull request #2073 from Budibase/fix/google-button
Mark google activated by default for old configs
gh-pages
Rory Powell
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
14 additions and
6 deletions
-
packages/worker/src/api/controllers/admin/configs.js
|
|
|
@ -150,14 +150,22 @@ exports.publicSettings = async function (ctx) { |
|
|
|
} |
|
|
|
|
|
|
|
// google button flag
|
|
|
|
const googleActivated = |
|
|
|
googleConfig.config.activated == undefined || // activated by default for configs pre-activated flag
|
|
|
|
googleConfig.config.activated |
|
|
|
config.config.google = !googleConfig ? false : googleActivated |
|
|
|
if (googleConfig && googleConfig.config) { |
|
|
|
const googleActivated = |
|
|
|
googleConfig.config.activated == undefined || // activated by default for configs pre-activated flag
|
|
|
|
googleConfig.config.activated |
|
|
|
config.config.google = googleActivated |
|
|
|
} else { |
|
|
|
config.config.google = false |
|
|
|
} |
|
|
|
|
|
|
|
// oidc button flag
|
|
|
|
const oidcActivated = !oidcConfig.config.configs[0].activated |
|
|
|
config.config.oidc = !oidcConfig ? false : oidcActivated |
|
|
|
if (oidcConfig && oidcConfig.config) { |
|
|
|
const oidcActivated = oidcConfig.config.configs[0].activated |
|
|
|
config.config.oidc = oidcActivated |
|
|
|
} else { |
|
|
|
config.config.oidc = false |
|
|
|
} |
|
|
|
|
|
|
|
ctx.body = config |
|
|
|
} catch (err) { |
|
|
|
|