eletrotupi / tcc/ api/src/schemas/auth.schema.tscabfc50ce67b5a9198187904f1fc2d5fdcf6f8e1
693 B | 25 lines Raw
1
import { z } from 'zod';
2

3
export const LoginSchema = z.object({
4
  email: z.string().email(),
5
  password: z.string().min(1)
6
});
7

8
export const PasswordResetRequestSchema = z.object({
9
  email: z.string().email()
10
});
11

12
export const PasswordResetSchema = z.object({
13
  token: z.string(),
14
  newPassword: z.string().min(6)
15
});
16

17
export const ActivateUserSchema = z.object({
18
  userId: z.number(),
19
  code: z.number().max(6)
20
});
21

22
export type LoginInput = z.infer<typeof LoginSchema>;
23
export type PasswordResetRequestInput = z.infer<typeof PasswordResetRequestSchema>;
24
export type PasswordResetInput = z.infer<typeof PasswordResetSchema>;
25
export type ActivateUserInput = z.infer<typeof ActivateUserSchema>;