From 6aebb9f22a5a5b8028f95698a0c46721d5e41c34 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Reza Date: Sun, 1 Dec 2024 10:42:40 +0700 Subject: [PATCH] update reset_token set null --- src/controllers/auth.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controllers/auth.ts b/src/controllers/auth.ts index 19021ce..96d5ee4 100644 --- a/src/controllers/auth.ts +++ b/src/controllers/auth.ts @@ -396,10 +396,9 @@ export class AuthController { const data = await userRepository.findOneBy({ reset_token: param.reset_token }); if (data != null) { - if (param.password) { - data.password = param.password - data.hashPassword(); - } + data.password = param.password; + data.reset_token = null; + data.hashPassword(); await userRepository.save(data);