mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
17 lines
609 B
TypeScript
17 lines
609 B
TypeScript
import { refinePasswords } from '$lib/validations/account'
|
|
import { z } from 'zod'
|
|
|
|
export const changePasswordDto = z
|
|
.object({
|
|
password: z.string({ required_error: 'Password is required' }).trim(),
|
|
confirm_password: z
|
|
.string({ required_error: 'Confirm Password is required' })
|
|
.trim()
|
|
.min(8, { message: 'Must be at least 8 characters' })
|
|
.max(128, { message: 'Must be less than 128 characters' }),
|
|
})
|
|
.superRefine(({ confirm_password, password }, ctx) => {
|
|
return refinePasswords(confirm_password, password, ctx)
|
|
})
|
|
|
|
export type ChangePasswordDto = z.infer<typeof changePasswordDto>
|