diff --git a/src/Login.tsx b/src/Login.tsx index c892af3..cddbf2e 100644 --- a/src/Login.tsx +++ b/src/Login.tsx @@ -8,57 +8,50 @@ // This Source Code Form is "Incompatible With Secondary Licenses", as // defined by the Mozilla Public License, v. 2.0. // -import { AppNav, Footer } from "./components/AppNav.tsx"; import { Container, Row, Col, Card, Button, Form } from "react-bootstrap"; import { atom, useAtomValue } from "jotai"; import { useNavigate } from "react-router-dom"; - export function Login() { return (
- - + -
); } - function LoginForm() { - const navigate = useNavigate(); + const navigate = useNavigate(); - const onSubmit = async (event) => { - event.preventDefault(); + const onSubmit = async (event) => { + event.preventDefault(); - console.log(event.target); - const formEntries = new FormData(event.target); - const formData = Object.fromEntries(formEntries); - console.log(formData); + console.log(event.target); + const formEntries = new FormData(event.target); + const formData = Object.fromEntries(formEntries); + console.log(formData); - const resp = await fetch("/api/login", { - method: 'POST', - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(formData), - }); - if(resp.redirected) { - navigate("/"); - } + const resp = await fetch("/api/login", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(formData), + }); + if (resp.redirected) { + navigate("/"); } - return ( -
- - Password - - + }; + return ( + + + Password + + - -
- ); + + + ); }