From 1861630bf3049745eb6006650384840ad573da15 Mon Sep 17 00:00:00 2001 From: andrzej Date: Fri, 13 Sep 2024 17:54:20 +0200 Subject: [PATCH] checkout login page from previous attempt --- src/app/login/page.tsx | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/app/login/page.tsx diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..9cbb82d --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,63 @@ +"use client" +import { useForm } from "react-hook-form"; +import { z } from "zod"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { toast } from "@/components/ui/use-toast"; +import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { signIn } from "app/api/auth/actions/sign-in"; + +const formSchema = z.object({ + email: z.string().email(), + password: z.string().min(6) +}) + +export default function LoginForm() { + const form = useForm>({ + resolver: zodResolver(formSchema), + }) + + function onErrors(errors) { + toast({ + title: "WHOOPS", + description: JSON.stringify(errors) + }) + } + + return ( +
+ + ( + + Email Address + + + + + + )} + > + ( + + Password + + + + + + )} + > + +
+ + + ) +} +