local login now functional
This commit is contained in:
parent
3b62d87d31
commit
ae9abaf9fd
9 changed files with 174 additions and 72 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { lazy, Suspense } from "react";
|
||||
import LoadingScreen from "../app/LoadingScreen";
|
||||
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
|
||||
import { useAuth0 } from "@auth0/auth0-react";
|
||||
import { useAuthContext } from "providers/authContext";
|
||||
import Header from "app/Header";
|
||||
import Logout from "pages/Logout";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
|
|
@ -57,7 +57,7 @@ export const appendToUrl = (appendage: number | string) => {
|
|||
|
||||
export default function Router() {
|
||||
|
||||
const { /*isAuthenticated, loginWithRedirect,*/ isLoading } = useAuth0();
|
||||
const { isAuthenticated } = useAuthContext();
|
||||
const whiteLabel = getWhitelabel();
|
||||
const [{ user }] = useGlobalState();
|
||||
|
||||
|
|
@ -306,13 +306,7 @@ export default function Router() {
|
|||
);
|
||||
}
|
||||
|
||||
if (isLoading) return null;
|
||||
// if (!isAuthenticated) {
|
||||
// loginWithRedirect()
|
||||
// return (
|
||||
// null
|
||||
// )
|
||||
// }
|
||||
if (!isAuthenticated) return null;
|
||||
|
||||
function ErrorFallback({ error }: { error: Error }) {
|
||||
return <div>Something went wrong: {error.stack}</div>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue