aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschererleander <leander@schererleander.de>2025-12-26 16:07:58 +0100
committerschererleander <leander@schererleander.de>2025-12-26 16:07:58 +0100
commitba8c98a8dccb8b561747168b90ae769a105d37cf (patch)
treef67f1b23510d27a16c6ac0bfc449a6aece6c81a2 /src/lib
parent4b564ae2ef6d47e548ff3f1c6513605b8f2509ed (diff)
refactor: implement server-side rendering for auth-dependent pages
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/validation.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/validation.ts b/src/lib/validation.ts
index 02983e4..ab9416e 100644
--- a/src/lib/validation.ts
+++ b/src/lib/validation.ts
@@ -45,11 +45,19 @@ export const updatePasswordSchema = z.object({
newPassword: registerSchema.shape.password,
})
+export const passwordChangeSchema = updatePasswordSchema.extend({
+ confirmPassword: z.string()
+}).refine((data) => data.newPassword === data.confirmPassword, {
+ message: "Passwords don't match",
+ path: ["confirmPassword"],
+})
+
// Type inference from schemas
export type RegisterInput = z.infer<typeof registerSchema>
export type LoginInput = z.infer<typeof loginSchema>
export type UpdateProfileInput = z.infer<typeof updateProfileSchema>
export type UpdatePasswordInput = z.infer<typeof updatePasswordSchema>
+export type PasswordChangeInput = z.infer<typeof passwordChangeSchema>
export const emailSchema = z.object({
email: z