Fix mobile photo upload: resize large camera images + increase body limit

Mobile cameras produce 8-12MB photos. Now:
- Canvas-based resize to max 2000x1500 before upload
- JPEG compression at 0.7-0.85 quality
- Express body limit increased to 5MB for id-upload route
- Falls back to raw upload for small images and PDFs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-30 17:24:16 -05:00
parent 04861ccfe0
commit f60c5229ab
2 changed files with 50 additions and 7 deletions

View file

@ -69,6 +69,8 @@ app.use("/api/v1/webhooks/stripe", express.raw({ type: "application/json" }));
app.use(identityRouter); // identity webhook uses raw() internally on its specific route
// Photo ID upload needs larger body (resized images up to ~3MB as base64)
app.use("/api/v1/id-upload", express.json({ limit: "5mb" }));
app.use(express.json({ limit: "512kb" })); // 512kb for eSign signature PNG base64
// Reject non-JSON content types on POST/PUT/PATCH