fix idp on started

This commit is contained in:
lendry
2026-06-24 17:53:58 +03:00
parent b6987f4aea
commit 21f2a1c227
7 changed files with 211 additions and 50 deletions

View File

@@ -9,8 +9,8 @@ function resolveBrowserApiBaseUrl(): string {
try {
const configured = new URL(configuredApiUrl);
if (configured.origin !== window.location.origin) {
return `${window.location.origin}${API_ORIGIN_PROXY_PREFIX}`;
if (configured.hostname !== window.location.hostname) {
return API_ORIGIN_PROXY_PREFIX;
}
} catch {
// keep configured URL
@@ -24,9 +24,15 @@ function resolveBrowserWsBaseUrl(): string {
return configuredWsUrl;
}
const apiBase = resolveBrowserApiBaseUrl();
if (apiBase === API_ORIGIN_PROXY_PREFIX) {
const scheme = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
return `${scheme}//${window.location.host}${API_ORIGIN_PROXY_PREFIX}/ws`;
}
try {
const configured = new URL(configuredWsUrl);
if (configured.origin !== window.location.origin) {
if (configured.hostname !== window.location.hostname) {
const scheme = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
return `${scheme}//${window.location.host}${API_ORIGIN_PROXY_PREFIX}/ws`;
}