simpler check using checklist
This commit is contained in:
parent
6a293df4be
commit
2636c9450b
|
@ -2,17 +2,11 @@
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import { ActionButton } from "@budibase/bbui"
|
import { ActionButton } from "@budibase/bbui"
|
||||||
import GoogleLogo from "/assets/google-logo.png"
|
import GoogleLogo from "/assets/google-logo.png"
|
||||||
|
import { admin } from "stores/portal"
|
||||||
|
|
||||||
let show = false
|
let show = false
|
||||||
|
|
||||||
async function fetchConfig() {
|
$: show = $admin.checklist?.oauth
|
||||||
const googleResponse = await api.get(
|
|
||||||
`/api/admin/configs/${ConfigTypes.Google}`
|
|
||||||
)
|
|
||||||
const googleDoc = await googleResponse.json()
|
|
||||||
|
|
||||||
if (googleDoc._id) show = true
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if show}
|
{#if show}
|
||||||
|
|
|
@ -168,6 +168,11 @@ exports.configChecklist = async function (ctx) {
|
||||||
type: Configs.SMTP,
|
type: Configs.SMTP,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// They have set up Google Auth
|
||||||
|
const oauthConfig = await getScopedFullConfig(db, {
|
||||||
|
type: Configs.GOOGLE,
|
||||||
|
})
|
||||||
|
|
||||||
// They have set up an admin user
|
// They have set up an admin user
|
||||||
const users = await db.allDocs(
|
const users = await db.allDocs(
|
||||||
getGlobalUserParams(null, {
|
getGlobalUserParams(null, {
|
||||||
|
@ -180,6 +185,7 @@ exports.configChecklist = async function (ctx) {
|
||||||
apps: appDbNames.length,
|
apps: appDbNames.length,
|
||||||
smtp: !!smtpConfig,
|
smtp: !!smtpConfig,
|
||||||
adminUser,
|
adminUser,
|
||||||
|
oauth: !!oauthConfig,
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ctx.throw(err.status, err)
|
ctx.throw(err.status, err)
|
||||||
|
|
Loading…
Reference in New Issue