mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-09 21:14:22 +00:00
chore(forms): improvements to the sign-in and sign-up forms (#6813)
This commit is contained in:
@@ -24,11 +24,21 @@ export const authFormSchema = (type: string) =>
|
||||
invitationToken:
|
||||
type === "sign-in" ? z.string().optional() : z.string().optional(),
|
||||
|
||||
termsAndConditions:
|
||||
type === "sign-in" || process.env.NEXT_PUBLIC_IS_CLOUD_ENV !== "true"
|
||||
? z.boolean().optional()
|
||||
: z.boolean().refine((value) => value === true, {
|
||||
message: "You must accept the terms and conditions.",
|
||||
}),
|
||||
|
||||
// Fields for Sign In and Sign Up
|
||||
email: z.string().email(),
|
||||
password: z.string().min(12, {
|
||||
message: "It must contain at least 12 characters.",
|
||||
}),
|
||||
password:
|
||||
type === "sign-in"
|
||||
? z.string()
|
||||
: z.string().min(12, {
|
||||
message: "It must contain at least 12 characters.",
|
||||
}),
|
||||
})
|
||||
.refine(
|
||||
(data) => type === "sign-in" || data.password === data.confirmPassword,
|
||||
|
||||
Reference in New Issue
Block a user