feat: enhance CORS configuration and implement throttling for API endpoints; add admin role checks in controllers

This commit is contained in:
Nils-Johan Gynther
2026-04-21 08:17:44 +02:00
parent 7748ad311f
commit e370062b5c
10 changed files with 44 additions and 24 deletions
@@ -3,7 +3,6 @@ import {
Post,
Request,
UploadedFile,
UseGuards,
UseInterceptors,
BadRequestException,
} from '@nestjs/common';
@@ -12,7 +11,6 @@ import { FileInterceptor } from '@nestjs/platform-express';
import { memoryStorage } from 'multer';
import { ReceiptImportService } from './receipt-import.service';
import { ParsedReceiptItem } from './dto/parsed-receipt-item.dto';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
const ALLOWED_MIMES = [
'image/jpeg',
@@ -29,7 +27,6 @@ export class ReceiptImportController {
@Post()
@Throttle({ default: { ttl: 60_000, limit: 20 } })
@UseGuards(JwtAuthGuard)
@UseInterceptors(
FileInterceptor('file', {
storage: memoryStorage(),