fix: #12481, remove priv groups from groupslug:groupname mapping (#12482)

this will cause a 404 when trying to access /group/cid-1-privilige-groups-find as an admin
This commit is contained in:
Barış Soner Uşaklı
2024-04-08 15:59:17 -04:00
committed by GitHub
parent b61936294b
commit 7033d11ede
5 changed files with 54 additions and 7 deletions

View File

@@ -34,6 +34,9 @@ groupsController.list = async function (req, res) {
groupsController.get = async function (req, res, next) {
const slug = slugify(req.params.name);
const groupName = await groups.getGroupNameByGroupSlug(slug);
if (!groupName) {
return next();
}
const [groupNames, group] = await Promise.all([
getGroupNames(),
groups.get(groupName, { uid: req.uid, truncateUserList: true, userListCount: 20 }),