mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
Checkpoint
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import ReactDOM from "react-dom";
|
||||
import {BrowserRouter} from "react-router-dom";
|
||||
import {BrowserRouter, useNavigate} from "react-router-dom";
|
||||
import {Auth0Provider} from "@auth0/auth0-react";
|
||||
import App from "App";
|
||||
|
||||
@ -13,18 +13,49 @@ import React from "react";
|
||||
const domain = process.env.REACT_APP_AUTH0_DOMAIN;
|
||||
const clientId = process.env.REACT_APP_AUTH0_CLIENT_ID;
|
||||
|
||||
/*
|
||||
ReactDOM.render(
|
||||
<Auth0Provider
|
||||
domain={domain}
|
||||
clientId={clientId}
|
||||
redirectUri={`${window.location.origin}/dashboards/analytics`}
|
||||
>
|
||||
<BrowserRouter>
|
||||
<BrowserRouter>
|
||||
<MaterialUIControllerProvider>
|
||||
<ProtectedRoute component={App} />
|
||||
</MaterialUIControllerProvider>
|
||||
</BrowserRouter>,
|
||||
document.getElementById("root"),
|
||||
);
|
||||
*/
|
||||
|
||||
console.log("what");
|
||||
|
||||
// @ts-ignore
|
||||
function Auth0ProviderWithRedirectCallback({children, ...props})
|
||||
{
|
||||
const navigate = useNavigate();
|
||||
// @ts-ignore
|
||||
const onRedirectCallback = (appState) =>
|
||||
{
|
||||
navigate((appState && appState.returnTo) || window.location.pathname);
|
||||
};
|
||||
return (
|
||||
// @ts-ignore
|
||||
<Auth0Provider onRedirectCallback={onRedirectCallback} {...props}>
|
||||
{children}
|
||||
</Auth0Provider>
|
||||
);
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<BrowserRouter>
|
||||
<Auth0ProviderWithRedirectCallback
|
||||
domain={domain}
|
||||
clientId={clientId}
|
||||
redirectUri={`${window.location.origin}/dashboards/analytics`}
|
||||
>
|
||||
<MaterialUIControllerProvider>
|
||||
<ProtectedRoute component={App} />
|
||||
</MaterialUIControllerProvider>
|
||||
</BrowserRouter>
|
||||
</Auth0Provider>,
|
||||
</Auth0ProviderWithRedirectCallback>
|
||||
</BrowserRouter>,
|
||||
document.getElementById("root"),
|
||||
);
|
||||
|
||||
export * from "components/MDButton";
|
||||
|
Reference in New Issue
Block a user