mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-11-18 17:45:13 +01: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:
9
src/infrastructure/sso/overrides/Authenticating.tsx
Normal file
9
src/infrastructure/sso/overrides/Authenticating.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { FunctionComponent } from "react";
|
||||
import { SSOResult } from "../models/SSOResult";
|
||||
|
||||
export const Authenticating: FunctionComponent<SSOResult> = ({ configurationName }) => (
|
||||
<>
|
||||
<h1>Authentication in progress for {configurationName}</h1>
|
||||
<p>You will be redirected to the login page.</p>
|
||||
</>
|
||||
);
|
||||
9
src/infrastructure/sso/overrides/AuthenticatingError.tsx
Normal file
9
src/infrastructure/sso/overrides/AuthenticatingError.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { FunctionComponent } from "react";
|
||||
import { SSOResult } from "../models/SSOResult";
|
||||
|
||||
export const AuthenticatingError: FunctionComponent<SSOResult> = ({ configurationName }) => (
|
||||
<>
|
||||
<h1>Error for {configurationName}</h1>
|
||||
<p>An error occurred during authentication.</p>
|
||||
</>
|
||||
);
|
||||
9
src/infrastructure/sso/overrides/CallBackSuccess.tsx
Normal file
9
src/infrastructure/sso/overrides/CallBackSuccess.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { FunctionComponent } from "react";
|
||||
import { SSOResult } from "../models/SSOResult";
|
||||
|
||||
export const CallBackSuccess: FunctionComponent<SSOResult> = ({ configurationName }) => (
|
||||
<>
|
||||
<h1>Authentication complete for {configurationName}</h1>
|
||||
<p>You will be redirected...</p>
|
||||
</>
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
import { FunctionComponent } from "react";
|
||||
import { SSOResult } from "../models/SSOResult";
|
||||
|
||||
export const ServiceWorkerNotSupported: FunctionComponent<SSOResult> = ({ configurationName }) => (
|
||||
<>
|
||||
<h1>Unable to authenticate on this browser for {configurationName}</h1>
|
||||
<p>Your browser is not configured to support Service Workers.</p>
|
||||
</>
|
||||
);
|
||||
17
src/infrastructure/sso/overrides/SessionLost.tsx
Normal file
17
src/infrastructure/sso/overrides/SessionLost.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useOidc } from "@axa-fr/react-oidc";
|
||||
import { FunctionComponent } from "react";
|
||||
import { SSOResult } from "../models/SSOResult";
|
||||
|
||||
export const SessionLost: FunctionComponent<SSOResult> = ({ configurationName }) => {
|
||||
const { login } = useOidc(configurationName);
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1>Session timed out for {configurationName}</h1>
|
||||
<p>Your session has expired. Please re-authenticate.</p>
|
||||
<button type="button" onClick={() => login("/")}>
|
||||
Login
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user