Skip to content

Commit

Permalink
#2 validation folder alo added in the fix along with full appwrite-au…
Browse files Browse the repository at this point in the history
…th with cookie fix
  • Loading branch information
wpsadi committed Nov 19, 2024
1 parent 06be23b commit 7715f71
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions validations/user/recoveryPassword.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { z } from "zod";

export const recoveryPasswordSchema = z.object({
email: z
.string({
required_error: "Email is required",
invalid_type_error: "Email must be a string",
})
.email({message: "Invalid email"}),
})
19 changes: 19 additions & 0 deletions validations/user/recoveryPasswordConfirm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { z } from "zod";

export const recoveryPasswordConfirmSchema = z.object({
newPassword: z
.string({
required_error: "New password is required",
invalid_type_error: "New password must be a string",
})
.min(6, {message: "New password must be at least 6 characters long"}),
confirmPassword: z
.string({
required_error: "Confirm password is required",
invalid_type_error: "Confirm password must be a string",
})
.min(6, {message: "Confirm password must be at least 6 characters long"}),
}).refine(data => data.newPassword === data.confirmPassword, {
message: "New password and confirm password must match",
path: ["confirmPassword"],
});

0 comments on commit 7715f71

Please sign in to comment.