simpler check using checklist

This commit is contained in:
Martin McKeaveney 2021-05-21 14:55:11 +01:00
parent c06edd8b44
commit bef216527d
2 changed files with 8 additions and 8 deletions

View File

@ -2,17 +2,11 @@
import { onMount } from "svelte"
import { ActionButton } from "@budibase/bbui"
import GoogleLogo from "/assets/google-logo.png"
import { admin } from "stores/portal"
let show = false
async function fetchConfig() {
const googleResponse = await api.get(
`/api/admin/configs/${ConfigTypes.Google}`
)
const googleDoc = await googleResponse.json()
if (googleDoc._id) show = true
}
$: show = $admin.checklist?.oauth
</script>
{#if show}

View File

@ -168,6 +168,11 @@ exports.configChecklist = async function (ctx) {
type: Configs.SMTP,
})
// They have set up Google Auth
const oauthConfig = await getScopedFullConfig(db, {
type: Configs.GOOGLE,
})
// They have set up an admin user
const users = await db.allDocs(
getGlobalUserParams(null, {
@ -180,6 +185,7 @@ exports.configChecklist = async function (ctx) {
apps: appDbNames.length,
smtp: !!smtpConfig,
adminUser,
oauth: !!oauthConfig,
}
} catch (err) {
ctx.throw(err.status, err)