We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7316ea commit 178c0d9Copy full SHA for 178c0d9
src/middleware/isAuthorized.ts
@@ -7,7 +7,7 @@ export const isAuthorized = async (req: Request, res: Response, next: NextFuncti
7
8
const routeKey = (req.baseUrl + req.route.path) as Route;
9
const routePermissions = permissions.get(routeKey);
10
- const isOwner = id && (req.params?.userId === id || req.params?.id === id);
+ const isOwner: boolean = (id && (req.params?.userId === id || req.params?.id === id)) || false;
11
12
console.log("routeKey", routeKey);
13
console.log("routePermissions", routePermissions);
0 commit comments