show proper error on phone when photo ID upload fails to MinIO

This commit is contained in:
justin 2026-05-30 18:13:18 -05:00
parent 7ef509c247
commit e0fc4810d1
2 changed files with 4 additions and 3 deletions

View file

@ -169,9 +169,9 @@ router.post("/api/v1/id-upload/:token", async (req: Request, res: Response) => {
paths.front = minioPath;
console.log(`[id-upload] Stored ${minioPath} (${buffer.length} bytes)`);
} else {
// Fallback: store base64 reference in DB
paths.front = `base64-pending:${buffer.length}bytes`;
console.warn("[id-upload] MinIO upload failed — stored reference only");
console.error("[id-upload] MinIO upload failed for", minioPath);
res.status(500).json({ error: "Upload failed — please try again, or upload the file from your computer instead." });
return;
}
// Update token