Use Keycloak config endpoint in production (#3471)
This commit is contained in:
parent
3694dad23c
commit
6a75c6da6b
1 changed files with 13 additions and 6 deletions
|
@ -71,14 +71,21 @@ export function useFetch<T>(
|
|||
}, deps);
|
||||
}
|
||||
|
||||
export async function initAdminClient() {
|
||||
const keycloak = new Keycloak({
|
||||
function getKeycloakConfig() {
|
||||
if (environment.isRunningAsTheme) {
|
||||
return environment.consoleBaseUrl + "config";
|
||||
}
|
||||
|
||||
return {
|
||||
url: environment.authServerUrl,
|
||||
realm: environment.loginRealm,
|
||||
clientId: environment.isRunningAsTheme
|
||||
? "security-admin-console"
|
||||
: "security-admin-console-v2",
|
||||
});
|
||||
clientId: "security-admin-console-v2",
|
||||
};
|
||||
}
|
||||
|
||||
export async function initAdminClient() {
|
||||
const config = getKeycloakConfig();
|
||||
const keycloak = new Keycloak(config);
|
||||
|
||||
await keycloak.init({ onLoad: "check-sso", pkceMethod: "S256" });
|
||||
|
||||
|
|
Loading…
Reference in a new issue