Skip to content

feat(phone-input): Add optional allowedCountries prop to PhoneInput - #594

Merged
irisrossellvitorica merged 2 commits into
freenowtech:mainfrom
irisrossellvitorica:SUP-57083/allow-to-restrict-countries-in-phone-input
Aug 25, 2026
Merged

feat(phone-input): Add optional allowedCountries prop to PhoneInput#594
irisrossellvitorica merged 2 commits into
freenowtech:mainfrom
irisrossellvitorica:SUP-57083/allow-to-restrict-countries-in-phone-input

Conversation

@irisrossellvitorica

@irisrossellvitorica irisrossellvitorica commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

This PR adds an optional prop to PhoneInput to only display the list of phone numbers provided, in case the prop is missing, display all countries as usual.

Why

Lately we're having a lot of bot triggered SMS fraud attempts where bots register in-mass using non-European phone numbers. Then they ask for a password reset, tiggering billable SMS sending which, being phone numbers outside of Europe, are costing a significant amount of money.

We are trying to mitigate this by only allowing registration and password resetting to European phone numbers. Both the web-registration countrycode picker and the password-reset one use wave's PhoneInput component.

Lets consumers restrict the country dropdown to a fixed allowlist of
ISO codes. Optional and backward compatible: when omitted, all
countries render as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@freenow/wave@594

commit: 06259f2

Comment thread src/components/PhoneInput/PhoneInput.tsx Outdated
@AlanFnz

AlanFnz commented Aug 24, 2026

Copy link
Copy Markdown
Member

Should we update the stories in order to cover this new prop? :)

@irisrossellvitorica
irisrossellvitorica merged commit 0755389 into freenowtech:main Aug 25, 2026
7 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 25, 2026
## 2.64.0 (2026-08-25)

* feat(phone-input): Add optional allowedCountries prop to PhoneInput (#594) ([0755389](0755389)), closes [#594](#594)
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.64.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants