[Chore] Rename old route

Also update readme
This commit is contained in:
ClaraCrazy 2026-01-07 09:26:51 +01:00
parent a2d3d54adf
commit 2fbf20e4e3
No known key found for this signature in database
GPG key ID: EBBC896ACB497011
5 changed files with 27 additions and 14 deletions

View file

@ -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! If you find this project useful, consider supporting its development!

View file

@ -12,17 +12,17 @@ router.get('/', async(req, res, next) => {
if (!mailProcessingService) { if (!mailProcessingService) {
throw new Error('Mail processing service not available') throw new Error('Mail processing service not available')
} }
debug('Login page requested') debug('Home page requested')
const context = templateContext.build(req, { const context = templateContext.build(req, {
username: randomWord() username: randomWord()
}) })
res.render('login', { res.render('home', {
...context, ...context,
title: `${context.branding[0]} | Your temporary Inbox` title: `${context.branding[0]} | Your temporary Inbox`
}) })
} catch (error) { } catch (error) {
debug('Error loading login page:', error.message) debug('Error loading home page:', error.message)
console.error('Error while loading login page', error) console.error('Error while loading home page', error)
next(error) next(error)
} }
}) })
@ -49,26 +49,26 @@ router.post(
} }
const errors = validationResult(req) const errors = validationResult(req)
if (!errors.isEmpty()) { 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, { const context = templateContext.build(req, {
userInputError: true, userInputError: true,
username: randomWord() username: randomWord()
}) })
return res.render('login', { return res.render('home', {
...context, ...context,
title: `${context.branding[0]} | Your temporary Inbox` title: `${context.branding[0]} | Your temporary Inbox`
}) })
} }
const inbox = `${req.body.username}@${req.body.domain}` 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}`) res.redirect(`/inbox/${inbox}`)
} catch (error) { } catch (error) {
debug('Error processing login:', error.message) debug('Error processing request:', error.message)
console.error('Error while processing login', error) console.error('Error while processing request', error)
next(error) next(error)
} }
} }
) )
module.exports = router module.exports = router

View file

@ -13,7 +13,7 @@ const socketio = require('socket.io')
const config = require('../../application/config') const config = require('../../application/config')
const createApiRouter = require('./api/router') const createApiRouter = require('./api/router')
const inboxRouter = require('./routes/inbox') const inboxRouter = require('./routes/inbox')
const loginRouter = require('./routes/login') const homeRouter = require('./routes/home')
const errorRouter = require('./routes/error') const errorRouter = require('./routes/error')
const lockRouter = require('./routes/lock') const lockRouter = require('./routes/lock')
const authRouter = require('./routes/auth') const authRouter = require('./routes/auth')
@ -185,7 +185,7 @@ app.use('/api/v1', (req, res, next) => {
}) })
// Web routes // Web routes
app.use('/', loginRouter) app.use('/', homeRouter)
if (config.user.authEnabled) { if (config.user.authEnabled) {
app.use('/', authRouter) app.use('/', authRouter)
app.use('/', accountRouter) app.use('/', accountRouter)

View file

@ -1,6 +1,6 @@
{ {
"name": "48hr.email", "name": "48hr.email",
"version": "2.3.0", "version": "2.3.2",
"private": false, "private": false,
"description": "48hr.email is your favorite open-source tempmail client.", "description": "48hr.email is your favorite open-source tempmail client.",
"keywords": [ "keywords": [