import { createSignal, useContext } from "solid-js"; import { LoginContext, ModalContext } from "./Root"; export function LoginForm() { const modal_ctx = useContext(ModalContext); const login_ctx = useContext(LoginContext); const [username, setUsername] = createSignal(""); const [password, setPassword] = createSignal(""); const [waiting, setWaiting] = createSignal(false); const [error, setError] = createSignal(false); async function loginFailed() { setError(true); setWaiting(false); setTimeout(() => { setError(false); }, 1000); } return (
); } // This function is responsible for sending the login request to the server // and storing the token in localstorage export async function submitLogin( username: string, password: string ): Promise