@keycloakify/keycloak-admin-ui
Version:
Repackaged Keycloak Admin UI
21 lines • 858 B
JavaScript
import { joinPath } from "../utils/joinPath";
export const convertClientToUrl = ({ rootUrl, baseUrl }, environment) => {
// absolute base url configured, use base url is
if (baseUrl === null || baseUrl === void 0 ? void 0 : baseUrl.startsWith("http")) {
return baseUrl;
}
if (rootUrl === "${authAdminUrl}") {
return joinPath(rootUrl.replace(/\$\{(authAdminUrl)\}/, environment.adminBaseUrl), baseUrl || "");
}
if (rootUrl === "${authBaseUrl}") {
return joinPath(rootUrl.replace(/\$\{(authBaseUrl)\}/, environment.serverBaseUrl), baseUrl || "");
}
if (rootUrl === null || rootUrl === void 0 ? void 0 : rootUrl.startsWith("http")) {
if (baseUrl) {
return joinPath(rootUrl, baseUrl);
}
return rootUrl;
}
return baseUrl;
};
//# sourceMappingURL=client-url.js.map