diff --git a/apps/admin-ui/src/context/auth/AdminClient.tsx b/apps/admin-ui/src/context/auth/AdminClient.tsx index 75d7d531ae..d5f873568e 100644 --- a/apps/admin-ui/src/context/auth/AdminClient.tsx +++ b/apps/admin-ui/src/context/auth/AdminClient.tsx @@ -71,21 +71,14 @@ export function useFetch( }, deps); } -function getKeycloakConfig() { - if (environment.isRunningAsTheme) { - return environment.consoleBaseUrl + "config"; - } - - return { +export async function initAdminClient() { + const keycloak = new Keycloak({ url: environment.authServerUrl, realm: environment.loginRealm, - clientId: "security-admin-console-v2", - }; -} - -export async function initAdminClient() { - const config = getKeycloakConfig(); - const keycloak = new Keycloak(config); + clientId: environment.isRunningAsTheme + ? "security-admin-console" + : "security-admin-console-v2", + }); await keycloak.init({ onLoad: "check-sso", pkceMethod: "S256" });