mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-08-12 12:29:44 +00:00
fix: prevent people from going to login and submit without sufficient session
also fix build errors for the 1000th time
This commit is contained in:
parent
3e87d263da
commit
9795849830
3 changed files with 17 additions and 12 deletions
|
|
@ -1,12 +1,10 @@
|
|||
import { useStore } from "@nanostores/react";
|
||||
import SubmitForm from "../components/submit-form";
|
||||
import { session } from "../session";
|
||||
import { useNavigate } from "react-router";
|
||||
import { Navigate } from "react-router";
|
||||
|
||||
export default function SubmitPage() {
|
||||
const navigate = useNavigate();
|
||||
const $session = useStore(session);
|
||||
|
||||
if (!$session) navigate("/login");
|
||||
if (!$session) return <Navigate to="/login" replace />;
|
||||
return <SubmitForm />;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue