From d22b0d56a5a46ca59e7ffdc8fb6263f6cc4300b4 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 4 Oct 2025 08:25:25 +0000 Subject: [PATCH] fix: Add JWT auth guard to photos controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The photos upload endpoint was missing authentication, causing 500 errors. Added @UseGuards(JwtAuthGuard) to protect all photo endpoints and ensure req.user is populated for photo operations. Fixes photo upload authentication issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../src/modules/photos/photos.controller.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maternal-app/maternal-app-backend/src/modules/photos/photos.controller.ts b/maternal-app/maternal-app-backend/src/modules/photos/photos.controller.ts index 377dfa2..61abc16 100644 --- a/maternal-app/maternal-app-backend/src/modules/photos/photos.controller.ts +++ b/maternal-app/maternal-app-backend/src/modules/photos/photos.controller.ts @@ -11,12 +11,15 @@ import { UseInterceptors, UploadedFile, BadRequestException, + UseGuards, } from '@nestjs/common'; import { FileInterceptor } from '@nestjs/platform-express'; import { PhotosService } from './photos.service'; import { PhotoType } from '../../database/entities/photo.entity'; +import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard'; @Controller('api/v1/photos') +@UseGuards(JwtAuthGuard) export class PhotosController { constructor(private readonly photosService: PhotosService) {}