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
+6 -3
View File
@@ -1,6 +1,8 @@
import { Router } from "express";
export const router = Router({ mergeParams: true });
const checkAuth = global.utils.checkAuth;
/**
* GET - get all groups
* responses:
@@ -8,9 +10,10 @@ export const router = Router({ mergeParams: true });
* - 201: {auth: false}
*/
router.get("/", async (req, res) => {
const auth = await checkAuth(req.cookies, res);
// check auth
const auth = await checkAuth(req.cookies, res);
if (!auth) {
return;
}
res.status(200).send(global.userManager.getAllGroups())
});
res.status(200).send(global.userManager.getAllGroups());
});