mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-09-13 11:49:39 +02:00
Added an example of an authentication protected page (tenders) Added an example with the built in proxy (to combat CORS) (tendersguru)
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { OidcProvider as ReactOidcProvider } from "@axa-fr/react-oidc";
|
|
import { FunctionComponent, ReactNode } from "react";
|
|
import { AppLoader } from "../loader/appLoader";
|
|
import { SSOConfiguration } from "./Configuration";
|
|
import { Authenticating } from "./overrides/Authenticating";
|
|
import { AuthenticatingError } from "./overrides/AuthenticatingError";
|
|
import { CallBackSuccess } from "./overrides/CallBackSuccess";
|
|
import { ServiceWorkerNotSupported } from "./overrides/ServiceWorkerNotSupported";
|
|
import { SessionLost } from "./overrides/SessionLost";
|
|
|
|
type Props = { children?: ReactNode; [x: string]: any };
|
|
|
|
export const OidcProvider: FunctionComponent<Props> = ({ children, ...rest }) => {
|
|
return (
|
|
<ReactOidcProvider
|
|
loadingComponent={AppLoader}
|
|
authenticatingErrorComponent={AuthenticatingError}
|
|
authenticatingComponent={Authenticating}
|
|
sessionLostComponent={SessionLost}
|
|
serviceWorkerNotSupportedComponent={ServiceWorkerNotSupported}
|
|
callbackSuccessComponent={CallBackSuccess}
|
|
configuration={SSOConfiguration}
|
|
{...rest}
|
|
>
|
|
{children}
|
|
</ReactOidcProvider>
|
|
);
|
|
};
|