-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2 validation folder alo added in the fix along with full appwrite-au…
…th with cookie fix
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"], | ||
}); |