v1.13.0: Reset Password

This commit is contained in:
Wingy 2020-10-30 11:15:00 -04:00
parent 10c585d230
commit 22ebde8a0b
7 changed files with 134 additions and 11 deletions

View file

@ -5,11 +5,11 @@ module.exports = (db) => {
const router = express.Router();
router.get('/:code', async (req, res) => {
const { doc } = (await db.allDocs({ include_docs: true }))
const row = (await db.allDocs({ include_docs: true }))
.rows
.find(({ doc }) => doc.signupToken === req.params.code)
res.render('confirm-account', { doc })
res.render('confirm-account', { doc: row ? row.doc : undefined })
});
router.post('/:code', async (req, res) => {