Skip to content

fix(routes): require authentication on upload, process, and generate-sheet endpoints - #1732

Open
singhanurag0317-bit wants to merge 1 commit into
souma9830:masterfrom
singhanurag0317-bit:feat/issue-891
Open

fix(routes): require authentication on upload, process, and generate-sheet endpoints#1732
singhanurag0317-bit wants to merge 1 commit into
souma9830:masterfrom
singhanurag0317-bit:feat/issue-891

Conversation

@singhanurag0317-bit

Copy link
Copy Markdown

Fix: Require authentication on upload, process, and print routes

Closes #891

Problem

Three critical routes lacked authMiddleware, letting anyone upload files, trigger AI processing, or generate print sheets without being logged in:

  • POST /api/upload (and /api/upload/batch)
  • POST /api/process
  • POST /api/print/generate-sheet

Change

Added authMiddleware to the handler chains:

  • backend/src/routes/upload.routes.js/ and /batch
  • backend/src/routes/image.routes.js/ and /process
  • backend/src/routes/print.routes.js/generate-sheet

The public GET /api/print/presets stays unauthenticated. /api/upload/batch is protected as well since it is the same unauthenticated file-upload vector.

Tests

New backend/src/__tests__/routeAuth.test.js (supertest integration):

  • Each protected POST route returns 401 with "No authentication token provided" when no token is sent.
  • GET /api/print/presets remains accessible without a token.

Full backend suite: 9 suites / 26 tests passing.

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@singhanurag0317-bit is attempting to deploy a commit to the souma9830's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: POST /api/upload, /api/process, and /api/print/generate-sheet have no authentication

1 participant