This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/static/js/layout.js
Tim f826718c03
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s
#73 begin implement keycloak
2024-08-25 21:52:35 +02:00

24 lines
491 B
JavaScript

const keycloak = new Keycloak({
url: 'https://auth.me-fit.eu',
realm: 'me-fit',
clientId: 'me-fit'
});
async function initKeycloak() {
try {
const authenticated = await keycloak.init({
checkLoginIframe: false,
});
console.log(`User is ${authenticated ? 'authenticated' : 'not authenticated'}`);
console.log({ keycloak });
} catch (error) {
console.error('Failed to initialize adapter:', error);
}
};
initKeycloak();
async function login() {
await keycloak.login();
};