Skip to content

fix: image generation 503 when Firebase Admin is not configured - #306

Open
driver727-pixel with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-image-generation-error
Open

fix: image generation 503 when Firebase Admin is not configured#306
driver727-pixel with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-image-generation-error

Conversation

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

All four image routes unconditionally called authenticateFirebaseUser, which throws 503 when adminAuth is null (Firebase Admin SDK unconfigured). This made character/board/background-removal image generation entirely unavailable in any deployment without Firebase Admin credentials, even when FAL_KEY is set.

Changes

  • server/routes/images.js — Accept adminAuth as a parameter; guard auth calls behind if (adminAuth). For /api/generate-board-image and /api/board-image-status (which use caller.uid for in-memory job tracking), fall back to { uid: 'anonymous' } when adminAuth is absent.
  • server/index.js — Pass adminAuth into registerImageRoutes.
// Before — always throws 503 when adminAuth is null
await authenticateFirebaseUser(req);

// After — gracefully skips verification when Firebase Admin is unconfigured
if (adminAuth) await authenticateFirebaseUser(req);

Follows the same graceful-degradation pattern already used in the admin and battle route registrations (both guard their auth-dependent paths with if (!adminAuth)).

…onfigured

Agent-Logs-Url: https://github.com/driver727-pixel/Punch-Skater/sessions/a38ed908-ed7e-419b-b395-4a78b83df3ee

Co-authored-by: driver727-pixel <269849721+driver727-pixel@users.noreply.github.com>
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.

2 participants