diff --git a/lib/database.js b/lib/database.js index f851f00..4ef646a 100644 --- a/lib/database.js +++ b/lib/database.js @@ -229,7 +229,8 @@ module.exports = { }, coins: 0, registered_ip: ip, - lastlogin_ip: ip + lastlogin_ip: ip, + admin: false }); resolve(true); }); diff --git a/router/index.js b/router/index.js index edafce1..cbd89e1 100644 --- a/router/index.js +++ b/router/index.js @@ -32,7 +32,7 @@ router.use('*', async (req, res, next) => { }); if ((await panelinfo_raw.statusText) === 'Not Found') return res.json({ error: 'Pterodactyl user not found' }); const panelinfo = await panelinfo_raw.json(); - if (panelinfo.attributes.root_admin != true) return res.redirect('/dashboard'); + if (panelinfo.attributes.root_admin != true && user.admin == false) return res.redirect('/dashboard'); } next(); });