39 lines
843 B
JavaScript
39 lines
843 B
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import App from './app';
|
|
import { AuthProvider } from "react-oidc-context";
|
|
|
|
//TODO remove debugging
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
console.log('development mode');
|
|
}
|
|
|
|
//since react 18
|
|
import { createRoot } from 'react-dom/client';
|
|
|
|
//create root container
|
|
const root = createRoot(document.getElementById("root"));
|
|
|
|
//open id connect config
|
|
const oidcConfig = {
|
|
authority: "https://kc.swingbe.de/realms/vbn",
|
|
client_id: "data.vbn.de",
|
|
redirect_uri: "http://localhost:8080",
|
|
onSigninCallback: () => {
|
|
window.history.replaceState(
|
|
{},
|
|
document.title,
|
|
window.location.pathname
|
|
)
|
|
}
|
|
}
|
|
|
|
//render root app
|
|
root.render(
|
|
<AuthProvider {...oidcConfig}>
|
|
<React.StrictMode>
|
|
<App />
|
|
</React.StrictMode>
|
|
</AuthProvider>
|
|
);
|