diff --git a/actions/auth.ts b/actions/auth.ts index 3c93021a12..2cdf70bfd2 100644 --- a/actions/auth.ts +++ b/actions/auth.ts @@ -1,19 +1,22 @@ "use server"; import { AuthError } from "next-auth"; +import { z } from "zod"; import { signIn, signOut } from "@/auth.config"; -// import { authFormSchema } from "@/types"; +import { authFormSchema } from "@/types"; -// const formSchema = authFormSchema("sign-in"); +const formSchemaSignIn = authFormSchema("sign-in"); -const defaultValues = { +const defaultValues: z.infer = { email: "", password: "", }; -// Fix TS types. -export async function authenticate(prevState: any, formData: any) { +export async function authenticate( + prevState: unknown, + formData: z.infer, +) { try { await new Promise((resolve) => setTimeout(resolve, 2000)); await signIn("credentials", {