commit
d161f979b6
|
@ -1,24 +1,26 @@
|
||||||
<script>
|
<script>
|
||||||
|
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
|
||||||
|
|
||||||
|
$: show = $admin.checklist?.oauth
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ActionButton>
|
{#if show}
|
||||||
<a target="_blank" href="/api/admin/auth/google">
|
<ActionButton>
|
||||||
<div class="inner">
|
<a target="_blank" href="/api/admin/auth/google">
|
||||||
<img src={GoogleLogo} alt="google icon" />
|
<div class="inner">
|
||||||
<p>Sign in with Google</p>
|
<img src={GoogleLogo} alt="google icon" />
|
||||||
</div>
|
<p>Sign in with Google</p>
|
||||||
</a>
|
</div>
|
||||||
</ActionButton>
|
</a>
|
||||||
|
</ActionButton>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.outer {
|
|
||||||
border: 1px solid #494949;
|
|
||||||
border-radius: 4px;
|
|
||||||
width: 100%;
|
|
||||||
background-color: var(--background-alt);
|
|
||||||
}
|
|
||||||
.inner {
|
.inner {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
|
@ -38,8 +38,13 @@
|
||||||
notifications.error("Invalid credentials")
|
notifications.error("Invalid credentials")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleKeydown(evt) {
|
||||||
|
if (evt.key === "Enter") login()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:window on:keydown={handleKeydown} />
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|
|
@ -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