diff --git a/packages/builder/src/components/common/VerificationPromptBanner.svelte b/packages/builder/src/components/common/VerificationPromptBanner.svelte new file mode 100644 index 0000000000..e9109ae0b1 --- /dev/null +++ b/packages/builder/src/components/common/VerificationPromptBanner.svelte @@ -0,0 +1,102 @@ + + +{#if user?.account?.verified === false} + +{/if} + + diff --git a/packages/builder/src/pages/builder/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte index 960822a39f..b216958045 100644 --- a/packages/builder/src/pages/builder/_layout.svelte +++ b/packages/builder/src/pages/builder/_layout.svelte @@ -3,7 +3,6 @@ import { admin, auth, licensing } from "stores/portal" import { onMount } from "svelte" import { CookieUtils, Constants } from "@budibase/frontend-core" - import { banner, BANNER_TYPES } from "@budibase/bbui" import { API } from "api" import Branding from "./Branding.svelte" @@ -17,32 +16,6 @@ $: user = $auth.user $: useAccountPortal = cloud && !$admin.disableAccountPortal - let showVerificationPrompt = false - - const checkVerification = user => { - if (!showVerificationPrompt && user?.account?.verified === false) { - showVerificationPrompt = true - banner.queue([ - { - message: `Please verify your account. We've sent the verification link to ${user.email}`, - type: BANNER_TYPES.NEUTRAL, - showCloseButton: false, - extraButtonAction: () => { - fetch(`${$admin.accountPortalUrl}/api/auth/reset`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ email: user.email }), - }) - }, - extraButtonText: "Resend email", - }, - ]) - } - } - - $: checkVerification(user) const validateTenantId = async () => { const host = window.location.host diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index 872151b4a3..1df2a90250 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -22,6 +22,7 @@ import { isActive, goto, layout, redirect } from "@roxi/routify" import { capitalise } from "helpers" import { onMount, onDestroy } from "svelte" + import VerificationPromptBanner from "components/common/VerificationPromptBanner.svelte" import CommandPalette from "components/commandPalette/CommandPalette.svelte" import TourWrap from "components/portal/onboarding/TourWrap.svelte" import TourPopover from "components/portal/onboarding/TourPopover.svelte" @@ -136,6 +137,7 @@ {/if}
+
{#if $store.initialised}
diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 006e69daca..9459eefff1 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -8,6 +8,7 @@ import Logo from "./_components/Logo.svelte" import UserDropdown from "./_components/UserDropdown.svelte" import HelpMenu from "components/common/HelpMenu.svelte" + import VerificationPromptBanner from "components/common/VerificationPromptBanner.svelte" import { sdk } from "@budibase/shared-core" let loaded = false @@ -55,6 +56,7 @@ {:else}
+