wacrm/src/app/api/whatsapp
Arnas Donauskas 3b924c85bc
fix(whatsapp): allow connecting Meta test numbers without a PIN
The WhatsApp config POST handler hard-failed with a 400 whenever a
number needed registration (first save or number change) and no
6-digit two-step-verification PIN was supplied. Meta test numbers
(Developer Console) are pre-registered by Meta and expose no PIN to
set, so test-number users could never complete setup (issue #242).

The PIN-based /{phone_number_id}/register call only governs inbound
webhook routing for production numbers under a shared WABA (issue
#136) — it has nothing to do with credential validity or outbound
sends. So treat it as best-effort: when no PIN is supplied, skip
/register, save the (already Meta-verified) credentials as connected,
and leave registered_at null. The response now reports `registered`
accurately and adds `registration_skipped` so the UI can react.

UI: the save handler no longer falsely claims the number is "Live"
on a skipped registration — it points at the existing "Not
registered" banner, which already offers a PIN-retry path. The PIN
field is relabelled (optional) with copy explaining it's only for
production inbound routing and that test numbers have no PIN.

Fixes #242

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 17:01:36 +03:00
..
broadcast fix(multi-user): share whatsapp_config + templates by account 2026-06-01 14:01:46 +03:00
config fix(whatsapp): allow connecting Meta test numbers without a PIN 2026-06-15 17:01:36 +03:00
media/[mediaId] fix(multi-user): share whatsapp_config + templates by account 2026-06-01 14:01:46 +03:00
react fix(multi-user): share whatsapp_config + templates by account 2026-06-01 14:01:46 +03:00
send fix(multi-user): share whatsapp_config + templates by account 2026-06-01 14:01:46 +03:00
templates fix(multi-user): share whatsapp_config + templates by account 2026-06-01 14:01:46 +03:00
webhook feat(contacts): prevent duplicate phone numbers on create/import (#212) 2026-06-08 15:52:38 +03:00