hedgedoc/commons/src/dtos/auth/update-password.dto.ts
Philip Molares 4b5bf870f2 feat(commons): add DTOs
Moving the DTOs to commons so frontend and backend use the same types.
Also introducing zod for validation.

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2025-03-29 22:09:01 +01:00

18 lines
526 B
TypeScript

/*
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { z } from 'zod'
export const UpdatePasswordSchema = z
.object({
currentPassword: z
.string()
.min(6)
.describe('The current password of the user'),
newPassword: z.string().min(6).describe('The new password of the user'),
})
.describe('DTO to update the password of a local user account')
export type UpdatePasswordDto = z.infer<typeof UpdatePasswordSchema>