This repository has been archived on 2025-11-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
qoverflow/server/routes/user/RequestReset.js

15 lines
443 B
JavaScript

const ResetRequest = require('../../db/models/ResetRequest');
async function RequestReset(req, res) {
const { username } = req.body;
const request = await ResetRequest.create({ user: username });
console.log(
`Your request to reset your password has been received. Visit http://localhost:3000/users/recover/${request.id} to reset your password.`
);
return res.sendStatus(200);
}
module.exports = RequestReset;