diff --git a/server/routes/index.js b/server/routes/index.js index 82399dc..f01d609 100644 --- a/server/routes/index.js +++ b/server/routes/index.js @@ -737,11 +737,14 @@ router.get('/logout', (req, res) => { router.get('/activate/:token', wrap(async (req, res) => { if (req.session.user) return res.redirect('/login') let token = req.params.token - let success = await API.User.Login.activationToken(token) - if (!success) return formError(req, res, 'Unknown or invalid activation token') - req.flash('message', {error: false, text: 'Your account has been activated! You may now log in.'}) + if (!success) { + req.flash('message', {error: true, text: 'Invalid or expired activation token.'}) + } else { + req.flash('message', {error: false, text: 'Your account has been activated! You may now log in.'}) + } + res.redirect('/login') }))