🛂 Legacy support op for Keycloak v17 (#564)

This commit is contained in:
Alicia Sykes
2022-05-16 21:45:13 +01:00
parent c04e80b44e
commit 19b71313d5
4 changed files with 13 additions and 2 deletions

View File

@@ -12,9 +12,12 @@ const getAppConfig = () => {
class KeycloakAuth {
constructor() {
const { auth } = getAppConfig();
const { serverUrl, realm, clientId } = auth.keycloak;
const {
serverUrl, realm, clientId, legacySupport,
} = auth.keycloak;
const url = legacySupport ? `${serverUrl}/auth` : serverUrl;
const initOptions = {
url: `${serverUrl}`, realm, clientId, onLoad: 'login-required',
url, realm, clientId, onLoad: 'login-required',
};
this.keycloakClient = Keycloak(initOptions);