fix: return JSON 401 for API routes instead of 302 redirect #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/api-json-401"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
API consumers using follow_redirects get an unambiguous error (JSON 401) instead of silently landing on the login page (HTTP 200). Browser routes (/dashboard, /qr) keep the 302 redirect.
Root cause: superclean-sys2 WhatsAppTransport entered infinite re-auth loops because 302→login page→200 looked like successful authentication.
Changes:
All tests pass (8 packages, 0 failures).
Do NOT auto-merge — this is a shared module change affecting whatsapp-monitor, pocketnanny, and superclean-sys2.