wacrm/src/app/api
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
..
account Merge pull request #190 from ArnasDon/feat/rate-limit-admin-account-endpoints 2026-06-01 15:12:49 +03:00
automations fix(account-sharing): stamp account_id on account-scoped inserts (#205) 2026-06-05 10:20:54 +03:00
flows fix(account-sharing): stamp account_id on flow and pipeline inserts (#210) 2026-06-05 16:06:47 +03:00
invitations/[token] feat(api): invitation create + peek + redeem endpoints 2026-05-31 17:32:46 +03:00
whatsapp fix(whatsapp): allow connecting Meta test numbers without a PIN 2026-06-15 17:01:36 +03:00