diff --git a/frontend/src/pages/login/login.tsx b/frontend/src/pages/login/login.tsx index 0a2ff03..adcae7c 100644 --- a/frontend/src/pages/login/login.tsx +++ b/frontend/src/pages/login/login.tsx @@ -8,14 +8,16 @@ import { Typography, } from "@mui/material"; import { ConstrainedContainer } from "../../components/app-layout/ConstrainedContainer"; -import { useSearchParams } from "react-router-dom"; +import { Navigate, useSearchParams } from "react-router-dom"; import { useCallback, useEffect, useState } from "react"; +import { useAuthStore } from "../../lib/store/authStore"; import { DiscordIcon } from "../../components/common/DiscordDefaultIcon"; import { GoogleIcon } from "../../components/common/GoogleIcon"; import { GitHubIcon } from "../../components/common/GitHubIcon"; import AlertBar from "../../components/alert/AlertBar"; export default function Login() { + const me = useAuthStore((s) => s.me); const [params] = useSearchParams(); const returnTo = params.get("returnTo") || "/"; const nextParam = encodeURIComponent(returnTo); @@ -65,6 +67,10 @@ export default function Login() { } }, [error, showError, params]); + if (me?.authenticated) { + return ; + } + return ( <>