styling, admin login logic improvements

This commit is contained in:
Aidan 2024-12-15 16:06:55 -05:00
parent 7b9ca4a6ea
commit 78d6d9f2e1
No known key found for this signature in database
GPG Key ID: 1773A01F0EFE4FC1
3 changed files with 15 additions and 2 deletions

5
app.js
View File

@ -126,11 +126,14 @@ function checkAdminAuth(req, res, next) {
if (req.session.admin) { if (req.session.admin) {
next(); next();
} else { } else {
res.redirect('/admin', { error: null }); res.redirect('/admin');
} }
} }
app.get('/admin', (req, res) => { app.get('/admin', (req, res) => {
if (req.session.admin) {
return res.redirect('/admin/dashboard');
}
res.render('admin-login', { currentPage: 'admin', error: null }); res.render('admin-login', { currentPage: 'admin', error: null });
}); });

View File

@ -48,6 +48,16 @@ h3 {
text-align: center; text-align: center;
} }
.lg-container {
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin: auto;
max-width: 1500px;
padding: 2rem;
text-align: center;
}
.il { .il {
color: #555; color: #555;
display: block; display: block;

View File

@ -1,5 +1,5 @@
<%- include('shards/header', { title: 'Admin Dashboard - p0ntus mail' }) %> <%- include('shards/header', { title: 'Admin Dashboard - p0ntus mail' }) %>
<div class="container"> <div class="lg-container">
<%- include('shards/nav', { currentPage: 'admin' }) %> <%- include('shards/nav', { currentPage: 'admin' }) %>
<i class="il mt-5">Dashboard</i> <i class="il mt-5">Dashboard</i>
<hr> <hr>