import * as React from 'react'; import {Avatar, Checkbox, FormControlLabel, Grid, Link} from "@mui/material"; import Typography from "@mui/material/Typography"; import LockOutlinedIcon from '@mui/icons-material/LockOutlined'; import TextField from "@mui/material/TextField"; import Button from "@mui/material/Button"; import Box from "@mui/material/Box"; import api from "../app/Api"; import routes from "./routes"; import session from "../app/Session"; import logo from "../img/ntfy2.svg"; import {NavLink} from "react-router-dom"; const Login = () => { const handleSubmit = async (event) => { event.preventDefault(); const data = new FormData(event.currentTarget); const user = { username: data.get('username'), password: data.get('password'), } const token = await api.login("http://localhost:2586"/*window.location.origin*/, user); console.log(`[Api] User auth for user ${user.username} successful, token is ${token}`); session.store(user.username, token); window.location.href = routes.app; }; return ( Sign in to your ntfy account
Reset password
Sign up
); } export default Login;