Merge pull request #5366 from overleaf/jk-move-password-reset-audit-log

[web] audit password reset before taking action

GitOrigin-RevId: 672f712658b4669a5a750dbc6f97d24ce35c332d
This commit is contained in:
June Kelly
2021-10-21 08:03:00 +00:00
committed by Copybot
parent c95ad5573f
commit 7292cfbd02
3 changed files with 8 additions and 8 deletions
@@ -93,11 +93,6 @@ async function setNewUserPassword(token, password, auditLog) {
}
}
const reset = await AuthenticationManager.promises.setUserPassword(
user,
password
)
await UserAuditLogHandler.promises.addEntry(
user._id,
'reset-password',
@@ -105,6 +100,11 @@ async function setNewUserPassword(token, password, auditLog) {
auditLog.ip
)
const reset = await AuthenticationManager.promises.setUserPassword(
user,
password
)
return { found: true, reset, userId: user._id }
}