oops accidentally broke password changes
This commit is contained in:
parent
9c6c7df92b
commit
62d5e395fa
3 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,7 @@ module.exports = ({ db, ensurePfp }) => {
|
|||
await ensurePfp(req.user._id)
|
||||
res.render('profile', { title: `Profile Settings - ${req.user._id}` })
|
||||
})
|
||||
|
||||
router.post('/pfp', verifyAuth(), async (req, res) => {
|
||||
req.user.pfp = req.body.image
|
||||
await db.put(req.user)
|
||||
|
@ -16,6 +17,11 @@ module.exports = ({ db, ensurePfp }) => {
|
|||
req.flash('success', 'Saved profile picture!')
|
||||
res.redirect(`${_CC.config.base}profile`)
|
||||
})
|
||||
|
||||
router.get('/password', verifyAuth(), async (req, res) => {
|
||||
await ensurePfp(req.user._id)
|
||||
res.render('profile-password', { title: `Profile Settings - Password - ${req.user._id}` })
|
||||
})
|
||||
router.post('/password', verifyAuth(), (req, res) => {
|
||||
if (!req.body.oldPassword) {
|
||||
req.flash('error', 'Old Password is required')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue