Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Aliyun SMS Connector incorrectly identifies a Hong Kong mobile phone number as a mainland Chinese mobile phone number #5889

Open
2 of 4 tasks
codehz opened this issue May 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working Engineering

Comments

@codehz
Copy link
Contributor

codehz commented May 17, 2024

Describe the bug

Aliyun SMS Connector incorrectly identifies a Hong Kong mobile phone number as a mainland Chinese mobile phone number

Expected behavior

send message to HK mobile successfully

How to reproduce?

generate a dummy 852 phone number, like 85268326366
try to register with this number

Context

  • Logto Cloud
  • Self-hosted, Logto version =
    • Container (Docker image)
    • Raw Node.js

Screenshots

image

I think the problem is

const isChinaNumber = (to: string) => /^(\+86|0086|86)?\d{11}$/.test(to);

HK number is exactly 11 digits...

@codehz codehz added the bug Something isn't working label May 17, 2024
@xiaoyijun
Copy link
Contributor

Hi @codehz thanks for your report, this is a known issue, and we're exploring a appropriate solution. Will keep you posted.

@xiaoyijun xiaoyijun self-assigned this May 17, 2024
@codehz
Copy link
Contributor Author

codehz commented May 17, 2024

Hi @codehz thanks for your report, this is a known issue, and we're exploring a appropriate solution. Will keep you posted.

Considering that the current mobile phone numbers obtained in the system all contain country code, I think we can directly use the prefix 86 to determine whether it is a Chinese mobile phone number. (aka use /^86\d{11}$/)

@linear linear bot removed the Discussion label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Engineering
Development

No branches or pull requests

2 participants