Repository navigation
Require explicit country code prefix for non-Indonesian WhatsApp numbers - #681
Merged
Merged
Conversation
A bare number like 85335473895 passed validation as a generic 8-15 digit international number, but Fonnte never delivered to it. Without a leading 0, 62 or an explicit +, the number is now rejected on both the API and the client. The checkout prefill adds + back to stored non-Indonesian numbers so they stay valid on resubmit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EkfojR2rGbgfbtPZufk3yD
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EkfojR2rGbgfbtPZufk3yD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tighten WhatsApp number validation to require an explicit country code prefix (either
0for Indonesian numbers or+for international numbers). Numbers without a prefix are now rejected, and non-Indonesian numbers are formatted with a+prefix when displayed in input fields.Changes
0or+prefix are now rejected during normalization, even if they fall within the valid length range (8–15 digits). This prevents ambiguous numbers like6591234567from being accepted without explicit country code indication.+when formatted for display (formatWhatsappNumberForInput), ensuring they remain valid if re-parsed. Indonesian numbers continue to be formatted with0prefix.+are rejectedImplementation details
hasExplicitCountryCodeflag tracks whether the input started with+, allowing the validation to distinguish between numbers that were explicitly prefixed versus those that were not.+prefix.libs/ui) and Go (apps/api) implementations.https://claude.ai/code/session_01EkfojR2rGbgfbtPZufk3yD