Skip to content

Commit

Permalink
correcting password reset
Browse files Browse the repository at this point in the history
  • Loading branch information
niyobern authored Jul 8, 2024
1 parent 2519b9b commit 0e9ff7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controller/userController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ export const recoverPassword = errorHandler(
{ expiresIn: '1h' }
);

const confirmLink = `${process.env.APP_URL}/api/v1/user/recover/confirm?recoverToken=${recoverToken}`;
const confirmLink = `${process.env.FRONTEND_URL}/reset-password/${recoverToken}`;

sendEmail('reset', user.email, {name: user.firstName, link:confirmLink})

return res.status(200).json({
message: 'Password reset token generated successfully',
confirmLink,
});
}
);
Expand Down

0 comments on commit 0e9ff7c

Please sign in to comment.