mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 16:19:26 +00:00
Block parents from the admin panel
This commit is contained in:
6
app.js
6
app.js
@@ -132,6 +132,12 @@ async function main() {
|
||||
|
||||
if (!allowed.includes(path) && !req.session.authenticated)
|
||||
return res.redirect(`/login?redirect_to=${req.path}`);
|
||||
else if (req.path !== '/admin/parent-login' &&
|
||||
!allowed.includes(path) &&
|
||||
req.session.userType === 'parent'
|
||||
)
|
||||
return res.redirect('/admin/parent-login');
|
||||
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user