fix: small fixes
This commit is contained in:
parent
f4b890b6b3
commit
3d40ff7912
4 changed files with 14 additions and 21 deletions
34
src/main.tsx
34
src/main.tsx
|
|
@ -1,35 +1,27 @@
|
|||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import {StrictMode} from 'react'
|
||||
import {createRoot} from 'react-dom/client'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
import {AuthProvider, type AuthProviderProps} from "react-oidc-context";
|
||||
import {type User, WebStorageStateStore} from "oidc-client-ts";
|
||||
import { BrowserRouter } from "react-router";
|
||||
import {BrowserRouter} from "react-router";
|
||||
|
||||
const onSigninCallback = (_user: User | void): void => {
|
||||
window.history.replaceState(
|
||||
{},
|
||||
document.title,
|
||||
window.location.pathname
|
||||
)
|
||||
window.history.replaceState({}, document.title, window.location.pathname)
|
||||
}
|
||||
|
||||
const oidcConfig: AuthProviderProps = {
|
||||
authority: "https://sso.sr2.uk/realms/sr2",
|
||||
client_id: "chris-dev",
|
||||
redirect_uri: "http://localhost:5173",
|
||||
redirect_uri: window.location.href,
|
||||
onSigninCallback: onSigninCallback,
|
||||
userStore: new WebStorageStateStore({ store: window.localStorage }),
|
||||
userStore: new WebStorageStateStore({store: window.localStorage}),
|
||||
};
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<AuthProvider {...oidcConfig}>
|
||||
<BrowserRouter>
|
||||
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
|
||||
</AuthProvider>
|
||||
</StrictMode>,
|
||||
)
|
||||
createRoot(document.getElementById('root')!).render(<StrictMode>
|
||||
<AuthProvider {...oidcConfig}>
|
||||
<BrowserRouter basename="/ui">
|
||||
<App/>
|
||||
</BrowserRouter>
|
||||
</AuthProvider>
|
||||
</StrictMode>,)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react'
|
|||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
base: '/ui/',
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue