Skip to content

Commit

Permalink
fix: encrypt password when changing
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuuun authored Nov 14, 2023
1 parent d00e543 commit 06bfea2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/routes/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ router.post('/password', async (req, res, next) => {
return res.status(400).send('비밀번호는 12자 이하이어야 합니다.');
}

const encrypted_password = await bcrypt.hash(
password,
saltRounds,
);

await User.update(
{
password: password,
password: encrypted_password,
},
{
where: {
Expand Down

0 comments on commit 06bfea2

Please sign in to comment.