This commit is contained in:
2024-02-13 20:56:54 +03:00
parent d7637f68cc
commit 8fbd3592e2
4 changed files with 111 additions and 0 deletions

View File

@@ -1,10 +1,28 @@
import React from 'react';
import ReactDom from 'react-dom';
import Keycloak from 'keycloak-js';
import App from './app';
export default () => <App/>;
const keycloak = new Keycloak({
url: 'https://kc.inno-js.ru',
realm: 'test',
clientId: 'jurnal'
});
const start = async () => {
try {
const authenticated = await keycloak.init({ onLoad: 'login-required' });
console.log(`User is ${authenticated ? 'authenticated' : 'not authenticated'}`);
} catch (error) {
console.error('Failed to initialize adapter:', error);
}
}
start();
export const mount = (Сomponent) => {
ReactDom.render(
<Сomponent/>,