mirror of https://github.com/xfarrow/blink.git
Update reset_password_routes.js
This commit is contained in:
parent
468e70c22b
commit
97783ab96a
|
@ -43,7 +43,7 @@ async function reset(req, res) {
|
||||||
if (requester) {
|
if (requester) {
|
||||||
const diffMilliseconds = Date.now() - requester.time_of_request.getTime();
|
const diffMilliseconds = Date.now() - requester.time_of_request.getTime();
|
||||||
// Check whether the request was not performed more than 30 minutes ago
|
// Check whether the request was not performed more than 30 minutes ago
|
||||||
if(diffMilliseconds / (1000 * 60) <= 30){
|
if (diffMilliseconds / (1000 * 60) <= 30) {
|
||||||
const newPassword = await bcrypt.hash(req.body.password, 10);
|
const newPassword = await bcrypt.hash(req.body.password, 10);
|
||||||
ResetPassword.resetPassword(newPassword, req.body.secret);
|
ResetPassword.resetPassword(newPassword, req.body.secret);
|
||||||
return res.status(204).send();
|
return res.status(204).send();
|
||||||
|
|
Loading…
Reference in New Issue