All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s
24 lines
491 B
JavaScript
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();
|
|
};
|