mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-23 03:36:42 +11:00
Update user.js
This commit is contained in:
parent
7e55a0785b
commit
b1e3c40b36
1 changed files with 1 additions and 6 deletions
|
@ -511,12 +511,7 @@ router.put("/settings/:type", auth, async (req, res, next) => {
|
||||||
id: req.user.id
|
id: req.user.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let match
|
const match = await checkPasswordArgon2(req.body.current)
|
||||||
if (user.password) {
|
|
||||||
match = await checkPasswordArgon2(req.body.password)
|
|
||||||
} else {
|
|
||||||
match = true
|
|
||||||
}
|
|
||||||
if (match) {
|
if (match) {
|
||||||
await user.update({
|
await user.update({
|
||||||
password: await argon2.hash(req.body.new)
|
password: await argon2.hash(req.body.new)
|
||||||
|
|
Loading…
Reference in a new issue