mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 08:25:46 +01:00
feat: added PUT /api/v1/users/:uid/password route
This commit is contained in:
@@ -106,3 +106,16 @@ async function processDeletion(uid, req, res) {
|
||||
email: userData.email,
|
||||
});
|
||||
}
|
||||
|
||||
Users.changePassword = async (req, res) => {
|
||||
req.body.uid = req.params.uid;
|
||||
await user.changePassword(req.user.uid, Object.assign(req.body, { ip: req.ip }));
|
||||
await events.log({
|
||||
type: 'password-change',
|
||||
uid: req.user.uid,
|
||||
targetUid: req.params.uid,
|
||||
ip: req.ip,
|
||||
});
|
||||
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user