Cleanup
This commit is contained in:
11
packages/features/auth/src/schemas/password-reset.schema.ts
Normal file
11
packages/features/auth/src/schemas/password-reset.schema.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const PasswordResetSchema = z
|
||||
.object({
|
||||
password: z.string().min(8).max(99),
|
||||
repeatPassword: z.string().min(8).max(99),
|
||||
})
|
||||
.refine((data) => data.password === data.repeatPassword, {
|
||||
message: 'Passwords do not match',
|
||||
path: ['repeatPassword'],
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const PasswordSignInSchema = z.object({
|
||||
email: z.string().email(),
|
||||
password: z.string().min(8).max(99),
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const PasswordSignUpSchema = z
|
||||
.object({
|
||||
email: z.string().email(),
|
||||
password: z.string().min(8).max(99),
|
||||
repeatPassword: z.string().min(8).max(99),
|
||||
})
|
||||
.refine(
|
||||
(schema) => {
|
||||
return schema.password === schema.repeatPassword;
|
||||
},
|
||||
{
|
||||
message: 'Passwords do not match',
|
||||
path: ['repeatPassword'],
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user