diff --git a/infrastructure/web/routes/inbox.js b/infrastructure/web/routes/inbox.js index 43dbf83..7710227 100644 --- a/infrastructure/web/routes/inbox.js +++ b/infrastructure/web/routes/inbox.js @@ -60,7 +60,7 @@ router.get( try { const mailProcessingService = req.app.get('mailProcessingService') await mailProcessingService.deleteSpecificEmail(req.params.address, req.params.uid) - res.redirect(`/${req.params.address}`) + res.redirect(`/inbox/${req.params.address}`) } catch (error) { console.error('error while deleting email', error) next(error) diff --git a/infrastructure/web/routes/login.js b/infrastructure/web/routes/login.js index 0db83b8..656e53a 100644 --- a/infrastructure/web/routes/login.js +++ b/infrastructure/web/routes/login.js @@ -15,8 +15,17 @@ router.get('/', (req, res, _next) => { }) }) -router.get('/random', (req, res, _next) => { - res.redirect(`/${randomWord()}@${config.email.domains[Math.floor(Math.random() * config.email.domains.length)]}`) +router.get('/inbox/random', (req, res, _next) => { + res.redirect(`/inbox/${randomWord()}@${config.email.domains[Math.floor(Math.random() * config.email.domains.length)]}`) +}) + +router.get('/logout', (req, res, _next) => { + + /** + * If we ever need a logout sequence, now we can have one! + */ + + res.redirect('/') }) router.post( @@ -38,7 +47,7 @@ router.post( }) } - res.redirect(`/${req.body.username}@${req.body.domain}`) + res.redirect(`/inbox/${req.body.username}@${req.body.domain}`) } ) diff --git a/infrastructure/web/views/error.twig b/infrastructure/web/views/error.twig index 095cef5..626a42d 100644 --- a/infrastructure/web/views/error.twig +++ b/infrastructure/web/views/error.twig @@ -1,7 +1,7 @@ {% extends 'layout.twig' %} {% block body %} -
+