Init
This commit is contained in:
21
script.js
Normal file
21
script.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
console.log("Keycloak Script running!");
|
||||||
|
const keycloak = new Keycloak({
|
||||||
|
realm: "schmoekerei",
|
||||||
|
url: "https://auth.xn--schmkerei-37a.de",
|
||||||
|
clientId: "heimdall"
|
||||||
|
});
|
||||||
|
|
||||||
|
keycloak.init({ onLoad: 'login-required' }).then(function(authenticated) {
|
||||||
|
if (authenticated) {
|
||||||
|
console.log("User is authenticated");
|
||||||
|
}
|
||||||
|
}).catch(function() {
|
||||||
|
console.error("Authenticated Failed");
|
||||||
|
});
|
||||||
|
|
||||||
|
const wrapper = document.querySelector("#config-buttons");
|
||||||
|
const kcUserLink = wrapper.querySelector("#users").cloneNode(true);
|
||||||
|
kcUserLink.href = "https://auth.xn--schmkerei-37a.de/realms/schmoekerei/account";
|
||||||
|
kcUserLink.id = "kcUserSettings";
|
||||||
|
wrapper.append(kcUserLink);
|
||||||
|
kcUserLink.querySelector("div").innerHTML = "Account-Einstellungen";
|
||||||
Reference in New Issue
Block a user