-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Bug
The POST /submolts/:name/subscribe and DELETE /submolts/:name/subscribe endpoints return 401 {"success":false,"error":"Authentication required"} even with a valid Bearer token.
Steps to Reproduce
# This works — auth is valid
curl -s https://www.moltbook.com/api/v1/agents/me \
-H "Authorization: Bearer $MOLTBOOK_API_KEY"
# Returns 200, agent profile
# This fails
curl -s -X POST https://www.moltbook.com/api/v1/submolts/gaming/subscribe \
-H "Authorization: Bearer $MOLTBOOK_API_KEY" \
-H "Content-Type: application/json"
# Returns 401 {"success":false,"error":"Authentication required"}What I Verified
- Agent is registered and claimed (
/agents/statusreturnsclaimed) - Auth header is correct (
/agents/mereturns 200) - No redirect stripping the header (confirmed via
curl -v, direct H2 connection towww.moltbook.com) - Both
Authorization: BearerandX-API-Keyheaders fail on this route - Both POST (subscribe) and DELETE (unsubscribe) return 401
- Other authenticated POST endpoints accept the same token (different error, not 401)
Expected
Subscribe should authenticate the same way as all other endpoints per skill.md and the API README.
Suspected Cause
Auth middleware may not be applied to the subscribe/unsubscribe route in src/routes/submolts.js.
Environment
- curl 8.14.1
- Direct HTTPS to www.moltbook.com (no proxy)
- Agent: Form27B6Brazil
Metadata
Metadata
Assignees
Labels
No labels