Skip to content

fix: add authentication to coupon and store creation endpoints - #18

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
FuturMix:fix/coupon-store-auth
Jun 15, 2026
Merged

fix: add authentication to coupon and store creation endpoints#18
ralyodio merged 1 commit into
profullstack:masterfrom
FuturMix:fix/coupon-store-auth

Conversation

@FuturMix

Copy link
Copy Markdown
Contributor

Fixes #17

Bug

POST /api/coupons and POST /api/stores have no authentication check. Any unauthenticated request can create coupons and stores, enabling spam injection, SEO poisoning, and data integrity issues.

Other mutation endpoints (POST /api/coupons/vote, POST /api/bounties, POST /api/bounties/[id]/claim) correctly use getSessionDid() from @/lib/auth.

Fix

Added getSessionDid() auth check to both POST handlers, matching the existing pattern used in other protected routes. Unauthenticated requests now receive 401 Authentication required.

Fixes profullstack#17

POST /api/coupons and POST /api/stores had no authentication,
allowing any unauthenticated request to create coupons and stores.

Added getSessionDid() auth check matching the pattern used in
other protected endpoints (POST /api/coupons/vote, POST /api/bounties).
@ralyodio
ralyodio merged commit 4e22b20 into profullstack:master Jun 15, 2026
5 checks passed
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: Unauthenticated coupon and store creation (missing auth check)

2 participants