qoc, text

This commit is contained in:
Timur Ercan
2023-01-13 17:17:50 +01:00
parent 89b79d8981
commit ef59ab1688

View File

@ -2,6 +2,7 @@ import { XCircleIcon } from "@heroicons/react/24/outline";
import { signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
import Link from "next/link"; import Link from "next/link";
import { FormProvider, SubmitHandler, useForm } from "react-hook-form"; import { FormProvider, SubmitHandler, useForm } from "react-hook-form";
import { Toast, Toaster } from "react-hot-toast";
import Logo from "./logo"; import Logo from "./logo";
@ -28,7 +29,7 @@ export default function Signup() {
}; };
const signUp: SubmitHandler<FormValues> = async (data) => { const signUp: SubmitHandler<FormValues> = async (data) => {
methods.clearErrors(); // methods.clearErrors();
await fetch("/api/auth/signup", { await fetch("/api/auth/signup", {
body: JSON.stringify({ body: JSON.stringify({
...data, ...data,
@ -152,7 +153,7 @@ export default function Signup() {
minLength: { minLength: {
value: 7, value: 7,
message: message:
"Password has to be at least 7 characters long.", "Your password has to be at least 7 characters long.",
}, },
})} })}
id="password" id="password"
@ -201,6 +202,7 @@ export default function Signup() {
</FormProvider> </FormProvider>
</div> </div>
</div> </div>
<Toaster position="top-center"></Toaster>
</> </>
); );
} }