keycloak
This commit is contained in:
@@ -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/>,
|
||||
|
||||
Reference in New Issue
Block a user