mirror of
https://github.com/Crazyco-xyz/48hr.email.git
synced 2026-01-08 18:59:36 +01:00
[Chore] Rename old route
Also update readme
This commit is contained in:
parent
a2d3d54adf
commit
2fbf20e4e3
5 changed files with 27 additions and 14 deletions
15
README.md
15
README.md
|
|
@ -136,7 +136,20 @@ If desired, you can also move the config file somewhere else (change volume moun
|
|||
|
||||
-----
|
||||
|
||||
## Support me
|
||||
## TODO:
|
||||
- Tor mode:
|
||||
- Light-weight mode that can run either standalone or alongside an http instance
|
||||
- Provides a minimal, js-less instance for our friends on the other side <3
|
||||
- Admin Dashboard:
|
||||
- Admin dashboard allows to edit (almost) all config entries
|
||||
- Includes patch / refactor to allow for hotswapping (almost) all config entries.
|
||||
- Polish:
|
||||
- Lots of polish required, consolidating files etc.
|
||||
<br>
|
||||
|
||||
-----
|
||||
|
||||
## Support me ❤️
|
||||
|
||||
If you find this project useful, consider supporting its development!
|
||||
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@ router.get('/', async(req, res, next) => {
|
|||
if (!mailProcessingService) {
|
||||
throw new Error('Mail processing service not available')
|
||||
}
|
||||
debug('Login page requested')
|
||||
debug('Home page requested')
|
||||
const context = templateContext.build(req, {
|
||||
username: randomWord()
|
||||
})
|
||||
res.render('login', {
|
||||
res.render('home', {
|
||||
...context,
|
||||
title: `${context.branding[0]} | Your temporary Inbox`
|
||||
})
|
||||
} catch (error) {
|
||||
debug('Error loading login page:', error.message)
|
||||
console.error('Error while loading login page', error)
|
||||
debug('Error loading home page:', error.message)
|
||||
console.error('Error while loading home page', error)
|
||||
next(error)
|
||||
}
|
||||
})
|
||||
|
|
@ -49,26 +49,26 @@ router.post(
|
|||
}
|
||||
const errors = validationResult(req)
|
||||
if (!errors.isEmpty()) {
|
||||
debug(`Login validation failed for ${req.body.username}@${req.body.domain}: ${errors.array().map(e => e.msg).join(', ')}`)
|
||||
debug(`Home validation failed for ${req.body.username}@${req.body.domain}: ${errors.array().map(e => e.msg).join(', ')}`)
|
||||
const context = templateContext.build(req, {
|
||||
userInputError: true,
|
||||
username: randomWord()
|
||||
})
|
||||
return res.render('login', {
|
||||
return res.render('home', {
|
||||
...context,
|
||||
title: `${context.branding[0]} | Your temporary Inbox`
|
||||
})
|
||||
}
|
||||
|
||||
const inbox = `${req.body.username}@${req.body.domain}`
|
||||
debug(`Login successful, redirecting to inbox: ${inbox}`)
|
||||
debug(`Home validation successful, redirecting to inbox: ${inbox}`)
|
||||
res.redirect(`/inbox/${inbox}`)
|
||||
} catch (error) {
|
||||
debug('Error processing login:', error.message)
|
||||
console.error('Error while processing login', error)
|
||||
debug('Error processing request:', error.message)
|
||||
console.error('Error while processing request', error)
|
||||
next(error)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
module.exports = router
|
||||
module.exports = router
|
||||
|
|
@ -13,7 +13,7 @@ const socketio = require('socket.io')
|
|||
const config = require('../../application/config')
|
||||
const createApiRouter = require('./api/router')
|
||||
const inboxRouter = require('./routes/inbox')
|
||||
const loginRouter = require('./routes/login')
|
||||
const homeRouter = require('./routes/home')
|
||||
const errorRouter = require('./routes/error')
|
||||
const lockRouter = require('./routes/lock')
|
||||
const authRouter = require('./routes/auth')
|
||||
|
|
@ -185,7 +185,7 @@ app.use('/api/v1', (req, res, next) => {
|
|||
})
|
||||
|
||||
// Web routes
|
||||
app.use('/', loginRouter)
|
||||
app.use('/', homeRouter)
|
||||
if (config.user.authEnabled) {
|
||||
app.use('/', authRouter)
|
||||
app.use('/', accountRouter)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "48hr.email",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.2",
|
||||
"private": false,
|
||||
"description": "48hr.email is your favorite open-source tempmail client.",
|
||||
"keywords": [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue