fix: catch authentication failures in async route handlers

This commit is contained in:
tdurieux committed 2026-09-06 09:17:37 +02:00
1 parent 11eb160d2b
commit 7210db2b61
5 files changed
+30 -20

No files matched your search

+1 -1
View File
@@ -64,8 +64,8 @@ router.use(
res: express.Response,
next: express.NextFunction
) => {
const user = await getUser(req);
try {
const user = await getUser(req);
// only admins are allowed here
isOwnerOrAdmin([], user);
next();