diff --git a/src/HandleAuthorizationError.tsx b/src/HandleAuthorizationError.tsx
index 6abbaf0..0bedfa9 100644
--- a/src/HandleAuthorizationError.tsx
+++ b/src/HandleAuthorizationError.tsx
@@ -19,26 +19,36 @@
* along with this program. If not, see .
*/
+import {Auth0Provider, useAuth0} from "@auth0/auth0-react";
import React, {useEffect} from "react";
import {useCookies} from "react-cookie";
import {SESSION_ID_COOKIE_NAME} from "App";
+import {AUTH0_CLIENT_ID, AUTH0_DOMAIN} from "index";
interface Props
{
errorMessage?: string;
}
+
function HandleAuthorizationError({errorMessage}: Props)
{
+
const [, , removeCookie] = useCookies([SESSION_ID_COOKIE_NAME]);
+ const {logout} = useAuth0();
useEffect(() =>
{
+ logout();
removeCookie(SESSION_ID_COOKIE_NAME, {path: "/"});
});
return (
-
{errorMessage}
+
+
+
);
}
diff --git a/src/index.tsx b/src/index.tsx
index 86cf484..95ebc2a 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -29,8 +29,8 @@ import {MaterialUIControllerProvider} from "context";
import HandleAuthorizationError from "HandleAuthorizationError";
import ProtectedRoute from "qqq/auth0/protected-route";
-const domain = process.env.REACT_APP_AUTH0_DOMAIN;
-const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;
+export const AUTH0_DOMAIN = process.env.REACT_APP_AUTH0_DOMAIN;
+export const AUTH0_CLIENT_ID = process.env.REACT_APP_AUTH0_CLIENT_ID;
// @ts-ignore
function Auth0ProviderWithRedirectCallback({children, ...props})
@@ -47,7 +47,9 @@ function Auth0ProviderWithRedirectCallback({children, ...props})
{
return (
// @ts-ignore
-
+
+
+
);
}
else
@@ -64,8 +66,8 @@ function Auth0ProviderWithRedirectCallback({children, ...props})
render(