SQUASH: I think I got it working

This commit is contained in:
2021-07-29 00:36:20 +10:00
parent 6b3db67a29
commit b51d22f1a1
4 changed files with 49 additions and 44 deletions
+5 -3
View File
@@ -3,8 +3,10 @@ const { accounts, recovery } = require('../database/models');
//auth/reset
const route = async (req, res) => {
//verify the recovery record exists
const record = recovery.findOne({
token: req.query.token
const record = await recovery.findOne({
where: {
token: req.query.token
}
});
if (!record) {
@@ -12,7 +14,7 @@ const route = async (req, res) => {
}
//redirect to the front-end
res.redirect(`${process.env.WEB_PROTOCOL}${process.env.WEB_RESET_ADDRESS}?email=${record.email}&token=${record.token}`);
res.redirect(`${process.env.WEB_PROTOCOL}://${process.env.WEB_RESET_ADDRESS}?email=${record.email}&token=${record.token}`);
return null;
};