diff --git a/Dockerfile.cloud b/Dockerfile.cloud index 39d282d66..2027342da 100644 --- a/Dockerfile.cloud +++ b/Dockerfile.cloud @@ -20,6 +20,7 @@ RUN pnpm i ### Build ### # Admin Console build env ENV CONSOLE_PUBLIC_URL=/ +ENV IS_CLOUD=1 # Temporarily use it for Admin Console build, will try to use runtime technique later ENV ADMIN_TENANT_ENDPOINT=https://admin.app.logto.dev/ RUN pnpm prepack diff --git a/packages/console/src/containers/AppLayout/components/UserInfo/index.tsx b/packages/console/src/containers/AppLayout/components/UserInfo/index.tsx index 43cdf7d86..2ef929f97 100644 --- a/packages/console/src/containers/AppLayout/components/UserInfo/index.tsx +++ b/packages/console/src/containers/AppLayout/components/UserInfo/index.tsx @@ -16,6 +16,7 @@ import Dropdown, { DropdownItem } from '@/components/Dropdown'; import Spacer from '@/components/Spacer'; import { Ring as Spinner } from '@/components/Spinner'; import UserAvatar from '@/components/UserAvatar'; +import { getBasename } from '@/consts'; import useUserPreferences from '@/hooks/use-user-preferences'; import { onKeyDownHandler } from '@/utils/a11y'; @@ -144,7 +145,7 @@ const UserInfo = () => { return; } setIsLoading(true); - void signOut(`${window.location.origin}/console`); + void signOut(new URL(getBasename(), window.location.origin).toString()); }} > {t('menu.sign_out')} diff --git a/packages/core/src/tenants/Tenant.ts b/packages/core/src/tenants/Tenant.ts index 5628e3438..ddcf11f1e 100644 --- a/packages/core/src/tenants/Tenant.ts +++ b/packages/core/src/tenants/Tenant.ts @@ -94,7 +94,13 @@ export default class Tenant implements TenantContext { ) ); } - } else { + } + + // In OSS, no need for mounting demo app in the admin tenant since it may cause confusion + // while distinguishing "demo app from admin tenant" and "demo app from user tenant"; + // on the cloud, we need to configure admin tenant sign-in experience, so a preview is needed for + // testing without signing out of the admin console. + if (id !== adminTenantId || EnvSet.values.isDomainBasedMultiTenancy) { // Mount demo app app.use( mount(