diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 20bdc9cb54..3b1ea47e8b 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -12,6 +12,7 @@ } from "@budibase/bbui" import ConfigChecklist from "components/common/ConfigChecklist.svelte" import { organisation, auth } from "stores/portal" + import { admin as adminStore } from "stores/portal" import { onMount } from "svelte" import UpdateUserInfoModal from "components/settings/UpdateUserInfoModal.svelte" import ChangePasswordModal from "components/settings/ChangePasswordModal.svelte" @@ -57,6 +58,16 @@ }, ]) } + + // add link to account portal if the user has access + if ($auth.user.account) { + menu = menu.concat([ + { + title: "Account", + href: $adminStore.accountPortalUrl, + }, + ]) + } return menu } diff --git a/packages/worker/src/api/controllers/global/users.js b/packages/worker/src/api/controllers/global/users.js index 7fd367964c..13959273cd 100644 --- a/packages/worker/src/api/controllers/global/users.js +++ b/packages/worker/src/api/controllers/global/users.js @@ -196,6 +196,11 @@ exports.getSelf = async ctx => { } // this will set the body await exports.find(ctx) + + // append the account portal session information if present + if (ctx.user.account) { + ctx.body.account = ctx.user.account + } } exports.updateSelf = async ctx => {