mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-20 06:37:23 +02:00
fix: catch authentication failures in async route handlers
This commit is contained in:
5 files changed
+30
-20
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user