styling, admin login logic improvements
This commit is contained in:
parent
7b9ca4a6ea
commit
78d6d9f2e1
5
app.js
5
app.js
@ -126,11 +126,14 @@ function checkAdminAuth(req, res, next) {
|
||||
if (req.session.admin) {
|
||||
next();
|
||||
} else {
|
||||
res.redirect('/admin', { error: null });
|
||||
res.redirect('/admin');
|
||||
}
|
||||
}
|
||||
|
||||
app.get('/admin', (req, res) => {
|
||||
if (req.session.admin) {
|
||||
return res.redirect('/admin/dashboard');
|
||||
}
|
||||
res.render('admin-login', { currentPage: 'admin', error: null });
|
||||
});
|
||||
|
||||
|
@ -48,6 +48,16 @@ h3 {
|
||||
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 {
|
||||
color: #555;
|
||||
display: block;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<%- include('shards/header', { title: 'Admin Dashboard - p0ntus mail' }) %>
|
||||
<div class="container">
|
||||
<div class="lg-container">
|
||||
<%- include('shards/nav', { currentPage: 'admin' }) %>
|
||||
<i class="il mt-5">Dashboard</i>
|
||||
<hr>
|
||||
|
Reference in New Issue
Block a user