Added react-oidc (use demo/demo)

Added an example of an authentication protected page (tenders)
Added an example with the built in proxy (to combat CORS) (tendersguru)
This commit is contained in:
2022-07-26 11:15:36 +02:00
parent 8496f5cfbe
commit b9d3025163
24 changed files with 400 additions and 33 deletions

View File

@@ -1,7 +1,9 @@
import { OidcSecure } from "@axa-fr/react-oidc";
import { FunctionComponent } from "react";
import { Route, Routes } from "react-router-dom";
import { AboutContainer } from "./features/about/About";
import { CounterContainer } from "./features/examples/counter/Counter";
import { Tenders } from "./features/examples/tenders/Tenders";
import { HomeContainer } from "./features/home/Home";
type Props = {};
@@ -9,15 +11,25 @@ export const ROUTE_KEYS = {
home: "",
about: "about",
counter: "counter",
tenders: "tenders",
};
export const AppRoutes: FunctionComponent<Props> = () => {
const { home, about, counter } = ROUTE_KEYS;
const { home, about, counter, tenders } = ROUTE_KEYS;
return (
<Routes>
<Route path={home} element={<HomeContainer />} />
<Route path={about} element={<AboutContainer />} />
<Route path={counter} element={<CounterContainer />} />
{/* a route with authentication */}
<Route
path={tenders}
element={
<OidcSecure>
<Tenders />
</OidcSecure>
}
/>
{/* <Route index element={<Home />} /> */}
{/* <Route path="teams" element={<Teams />}>
<Route path=":teamId" element={<Team />} />