mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
feat: require old password for password reset (#488)
* feat: require old password for password reset
This commit is contained in:
@ -67,11 +67,12 @@ export const profileRouter = router({
|
||||
.input(ZUpdatePasswordMutationSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
try {
|
||||
const { password } = input;
|
||||
const { password, currentPassword } = input;
|
||||
|
||||
return await updatePassword({
|
||||
userId: ctx.user.id,
|
||||
password,
|
||||
currentPassword,
|
||||
});
|
||||
} catch (err) {
|
||||
let message =
|
||||
|
||||
@ -10,6 +10,7 @@ export const ZUpdateProfileMutationSchema = z.object({
|
||||
});
|
||||
|
||||
export const ZUpdatePasswordMutationSchema = z.object({
|
||||
currentPassword: z.string().min(6),
|
||||
password: z.string().min(6),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user