Add user endpoints

This commit is contained in:
Owen Schwartz
2024-10-12 22:31:24 -04:00
parent 364b2c26c3
commit 4facb91d7a
16 changed files with 679 additions and 89 deletions

View File

@@ -7,7 +7,7 @@ import HttpCode from '@server/types/HttpCode';
export async function verifyResourceAccess(req: Request, res: Response, next: NextFunction) {
const userId = req.user!.id; // Assuming you have user information in the request
const resourceId = req.params.resourceId;
const resourceId = req.params.resourceId || req.body.resourceId || req.query.resourceId;
if (!userId) {
return next(createHttpError(HttpCode.UNAUTHORIZED, 'User not authenticated'));