mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00

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>
18 lines
526 B
TypeScript
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>
|