moved login page logic into the auth file to redirect correctly before auth redirects because you're unauthenticated

This commit is contained in:
Carter 2025-06-24 16:46:59 -06:00
parent f900ba6c9d
commit 15d2a6a690
3 changed files with 81 additions and 78 deletions

View file

@ -9,7 +9,6 @@ import { getWhitelabel } from "services/whiteLabel";
import Ventilation from "pages/VentEditor";
import { useGlobalState } from "providers";
import DeviceSupport from "pages/DeviceSupport";
import Login from "pages/Login";
const DeviceHistory = lazy(() => import("pages/DeviceHistory"));
const DevicePage = lazy(() => import("pages/Device"));
@ -54,7 +53,7 @@ export const appendToUrl = (appendage: number | string) => {
export default function Router() {
const { isAuthenticated, loginWithRedirect, isLoading } = useAuth0();
const { isLoading } = useAuth0();
const whiteLabel = getWhitelabel();
const [{ user }] = useGlobalState();
@ -303,7 +302,6 @@ export default function Router() {
{/* Redirects */}
<Route path="/callback" element={<Navigate to="/" />} />
<Route path="/login" element={<Login />} />
{/* <Route path="/team/:teamID" element={<Navigate to="/teams/:teamID" />} /> */}
{/* <Route path="/device/:deviceID" element={<Navigate to="/devices/:devicesID" />} /> */}
<Route path="" element={<Navigate to={whiteLabel.homePage ? whiteLabel.homePage : "/devices"} />} />