From 788771c5eb74cda95d2e490dfe981ed56cd1e63c Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:16:38 -0600 Subject: [PATCH] refactor: add password in validation --- apps/dokploy/server/api/routers/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/server/api/routers/auth.ts b/apps/dokploy/server/api/routers/auth.ts index cad77927..f0d3b495 100644 --- a/apps/dokploy/server/api/routers/auth.ts +++ b/apps/dokploy/server/api/routers/auth.ts @@ -188,9 +188,9 @@ export const authRouter = createTRPCRouter({ .mutation(async ({ ctx, input }) => { const currentAuth = await findAuthByEmail(ctx.user.email); - if (input.currentPassword) { + if (input.currentPassword || input.password) { const correctPassword = bcrypt.compareSync( - input.currentPassword, + input.currentPassword || "", currentAuth?.password || "", ); if (!correctPassword) {