From 880e8903216a062641eb7b9fbba5167422f63176 Mon Sep 17 00:00:00 2001 From: wangsijie Date: Thu, 25 Jan 2024 17:41:21 +0800 Subject: [PATCH] fix(core): get tenant endpoint (#5309) --- packages/core/src/libraries/protected-app.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/libraries/protected-app.ts b/packages/core/src/libraries/protected-app.ts index 595e6b9aa..e36a90833 100644 --- a/packages/core/src/libraries/protected-app.ts +++ b/packages/core/src/libraries/protected-app.ts @@ -6,7 +6,7 @@ import { } from '@logto/schemas'; import { isValidSubdomain } from '@logto/shared'; -import { EnvSet } from '#src/env-set/index.js'; +import { EnvSet, getTenantEndpoint } from '#src/env-set/index.js'; import RequestError from '#src/errors/RequestError/index.js'; import { defaultProtectedAppPageRules, @@ -117,7 +117,7 @@ export const createProtectedAppLibrary = (queries: Queries) => { const protectedAppConfigProviderConfig = await getProviderConfig(); - const { protectedAppMetadata, id, secret } = await findApplicationById(applicationId); + const { protectedAppMetadata, id, secret, tenantId } = await findApplicationById(applicationId); if (!protectedAppMetadata) { return; } @@ -129,7 +129,7 @@ export const createProtectedAppLibrary = (queries: Queries) => { sdkConfig: { appId: id, appSecret: secret, - endpoint: EnvSet.values.endpoint.href, + endpoint: getTenantEndpoint(tenantId, EnvSet.values).origin, }, };