🛂 Legacy support op for Keycloak v17 (#564)
This commit is contained in:
@@ -475,6 +475,11 @@
|
||||
"title": "Client ID",
|
||||
"type": "string",
|
||||
"description": "The Client ID of the client you created for use with Dashy"
|
||||
},
|
||||
"legacySupport": {
|
||||
"title": "Legacy Support",
|
||||
"type": "boolean",
|
||||
"description": "If using Keycloak 17 or older, then set this to true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user