mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
Merge pull request #49 from prowler-cloud/PRWLR-4698-Following-up-authNext
Fix TS types on auth.ts
This commit is contained in:
+8
-5
@@ -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<typeof formSchemaSignIn> = {
|
||||
email: "",
|
||||
password: "",
|
||||
};
|
||||
|
||||
// Fix TS types.
|
||||
export async function authenticate(prevState: any, formData: any) {
|
||||
export async function authenticate(
|
||||
prevState: unknown,
|
||||
formData: z.infer<typeof formSchemaSignIn>,
|
||||
) {
|
||||
try {
|
||||
await new Promise((resolve) => setTimeout(resolve, 2000));
|
||||
await signIn("credentials", {
|
||||
|
||||
Reference in New Issue
Block a user