1
0
Fork 0
mirror of synced 2024-09-30 17:18:14 +13:00

simpler check using checklist

This commit is contained in:
Martin McKeaveney 2021-05-21 14:55:11 +01:00
parent 6a293df4be
commit 2636c9450b
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)