Skip to content

Commit c464f48

Browse files
committed
fix: Update terms field default value to false and refine validation message in signup schema
1 parent e9c1b32 commit c464f48

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/actions/auth/signup/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const signupSchema = z
1010
.regex(/(?=.*[A-Z])/, 'Password must contain at least one uppercase letter')
1111
.regex(/(?=.*\d)/, 'Password must contain at least one number'),
1212
confirmPassword: z.string().min(1, 'Please confirm your password'),
13-
terms: z.literal(true, {
14-
errorMap: () => ({ message: 'You must accept the terms' })
13+
terms: z.boolean().refine(val => val === true, {
14+
message: 'You must accept the terms'
1515
}),
1616
})
1717
.refine((data) => data.password === data.confirmPassword, {

src/components/models/auth/SignupForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function SignupForm() {
2929
email: "",
3030
password: "",
3131
confirmPassword: "",
32-
terms: true,
32+
terms: false,
3333
},
3434
});
3535
const router = useRouter();

0 commit comments

Comments
 (0)