mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
refactor: fix cloud env (#3186)
Co-authored-by: Charles Zhao <charleszhao@silverhand.io>
This commit is contained in:
parent
09d2dac1ea
commit
720d1ecb33
3 changed files with 10 additions and 2 deletions
|
@ -20,6 +20,7 @@ RUN pnpm i
|
||||||
### Build ###
|
### Build ###
|
||||||
# Admin Console build env
|
# Admin Console build env
|
||||||
ENV CONSOLE_PUBLIC_URL=/
|
ENV CONSOLE_PUBLIC_URL=/
|
||||||
|
ENV IS_CLOUD=1
|
||||||
# Temporarily use it for Admin Console build, will try to use runtime technique later
|
# Temporarily use it for Admin Console build, will try to use runtime technique later
|
||||||
ENV ADMIN_TENANT_ENDPOINT=https://admin.app.logto.dev/
|
ENV ADMIN_TENANT_ENDPOINT=https://admin.app.logto.dev/
|
||||||
RUN pnpm prepack
|
RUN pnpm prepack
|
||||||
|
|
|
@ -16,6 +16,7 @@ import Dropdown, { DropdownItem } from '@/components/Dropdown';
|
||||||
import Spacer from '@/components/Spacer';
|
import Spacer from '@/components/Spacer';
|
||||||
import { Ring as Spinner } from '@/components/Spinner';
|
import { Ring as Spinner } from '@/components/Spinner';
|
||||||
import UserAvatar from '@/components/UserAvatar';
|
import UserAvatar from '@/components/UserAvatar';
|
||||||
|
import { getBasename } from '@/consts';
|
||||||
import useUserPreferences from '@/hooks/use-user-preferences';
|
import useUserPreferences from '@/hooks/use-user-preferences';
|
||||||
import { onKeyDownHandler } from '@/utils/a11y';
|
import { onKeyDownHandler } from '@/utils/a11y';
|
||||||
|
|
||||||
|
@ -144,7 +145,7 @@ const UserInfo = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
void signOut(`${window.location.origin}/console`);
|
void signOut(new URL(getBasename(), window.location.origin).toString());
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('menu.sign_out')}
|
{t('menu.sign_out')}
|
||||||
|
|
|
@ -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
|
// Mount demo app
|
||||||
app.use(
|
app.use(
|
||||||
mount(
|
mount(
|
||||||
|
|
Loading…
Reference in a new issue