fix and update
This commit is contained in:
@@ -7,16 +7,25 @@ function resolveBrowserApiBaseUrl(): string {
|
||||
return configuredApiUrl;
|
||||
}
|
||||
|
||||
try {
|
||||
const configured = new URL(configuredApiUrl);
|
||||
if (configured.hostname !== window.location.hostname) {
|
||||
return API_ORIGIN_PROXY_PREFIX;
|
||||
}
|
||||
} catch {
|
||||
// keep configured URL
|
||||
if (configuredApiUrl.startsWith('/')) {
|
||||
return configuredApiUrl.replace(/\/+$/, '') || API_ORIGIN_PROXY_PREFIX;
|
||||
}
|
||||
|
||||
return configuredApiUrl;
|
||||
try {
|
||||
const configured = new URL(configuredApiUrl);
|
||||
const sameHost =
|
||||
configured.hostname === window.location.hostname &&
|
||||
(configured.port || (configured.protocol === 'https:' ? '443' : '80')) ===
|
||||
(window.location.port || (window.location.protocol === 'https:' ? '443' : '80'));
|
||||
|
||||
if (sameHost) {
|
||||
return API_ORIGIN_PROXY_PREFIX;
|
||||
}
|
||||
|
||||
return configuredApiUrl.replace(/\/+$/, '');
|
||||
} catch {
|
||||
return API_ORIGIN_PROXY_PREFIX;
|
||||
}
|
||||
}
|
||||
|
||||
function resolveBrowserWsBaseUrl(): string {
|
||||
|
||||
@@ -31,7 +31,7 @@ export const SYSTEM_SETTING_CATALOG: SystemSettingMeta[] = [
|
||||
label: 'URL API (OAuth issuer)',
|
||||
group: 'general',
|
||||
type: 'text',
|
||||
hint: 'Базовый URL API для OAuth/OIDC и FedCM. При same-origin деплое: https://ваш-домен/idp-api'
|
||||
hint: 'Публичный URL, доступный из браузера пользователя. Не используйте api-gateway или другие Docker-имена. Пример: https://id.lendry.ru/idp-api'
|
||||
},
|
||||
{
|
||||
key: 'PUBLIC_FRONTEND_URL',
|
||||
|
||||
Reference in New Issue
Block a user