mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-23 17:44:52 +02:00
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:
@@ -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 />} />
|
||||
|
Reference in New Issue
Block a user