add missing valid pve token check to checkAuth

This commit is contained in:
2024-07-08 19:25:23 +00:00
parent 800033c6f8
commit 8f7ea51787
6 changed files with 42 additions and 12 deletions
+5 -1
View File
@@ -12,13 +12,17 @@ const getUserResources = global.utils.getUserResources;
* - 401: {auth: false}
*/
router.get("/dynamic/resources", async (req, res) => {
const params = {
username: req.cookies.username
};
// check auth
const auth = await checkAuth(req.cookies, res);
if (!auth) {
return;
}
const userObj = global.utils.getUserObjFromUsername(req.cookies.username);
const userObj = global.utils.getUserObjFromUsername(params.username);
const resources = await getUserResources(req, userObj);
res.status(200).send(resources);