From 0acfb6040e763d745ad8af83ad0cdde45a21eed7 Mon Sep 17 00:00:00 2001 From: Pablo Lara Date: Mon, 2 Sep 2024 07:33:57 +0200 Subject: [PATCH] feat: fix TS types on auth.ts --- actions/auth.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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", {