Skip to content

Fix: webhook POST handler crash — undefined request variable#96

Closed
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/webhook-post-undefined-request
Closed

Fix: webhook POST handler crash — undefined request variable#96
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/webhook-post-undefined-request

Conversation

@FuturMix

Copy link
Copy Markdown

Summary

Fixes #95

The POST handler in src/app/api/webhooks/route.js references a bare request variable that doesn't exist in the handler scope. The withAuth wrapper passes a single event object, so the request body must be accessed via event.request.json().

Changes

  • src/app/api/webhooks/route.js: Changed request.json()event.request.json() (line 28)

Test plan

  • Send POST /api/webhooks with valid auth and body — should return 201 instead of crashing
  • Verify GET /api/webhooks still works (unaffected)

🤖 Generated with Claude Code

…andler

The POST handler receives a single event object from withAuth(), but
references a bare `request` variable that is not defined in this scope.
This causes a ReferenceError crash whenever a user tries to create a
webhook. Use event.request.json() to correctly parse the request body.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ralyodio ralyodio closed this Jun 14, 2026
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: Webhook POST handler crashes — undefined request variable

2 participants