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) {
|
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 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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>
|
||||||
|
Reference in New Issue
Block a user