// Copyright (C) 2022-present Daniel31x13 // This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3. // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with this program. If not, see . import { signIn } from "next-auth/react"; import Link from "next/link"; import { useRouter } from "next/router"; import { useState } from "react"; interface FormData { email: string; password: string; } export default function () { const router = useRouter(); const [form, setForm] = useState({ email: "", password: "", }); async function loginUser() { console.log(form); if (form.email != "" && form.password != "") { const res = await signIn("credentials", { email: form.email, password: form.password, redirect: false, }); console.log(res); if (!res?.ok) { console.log("User not found or password does not match.", res); } } else { console.log("Please fill out all the fields."); } } return (

Linkwarden

setForm({ ...form, email: e.target.value })} className="border border-gray-700 rounded-md block m-2 mx-auto p-2" /> setForm({ ...form, password: e.target.value })} className="border border-gray-700 rounded-md block m-2 mx-auto p-2" />
Login
Register
); }