-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Fix: Correctly identify Chinese mobile numbers #5802
base: master
Are you sure you want to change the base?
Conversation
…umbers from being classified as Chinese mobile numbers.
COMPARE TO
|
Name | Diff |
---|---|
packages/connectors/connector-aliyun-sms/src/index.ts | 📉 -1 Bytes |
@@ -20,7 +20,7 @@ import { sendSms } from './single-send-text.js'; | |||
import type { Template } from './types.js'; | |||
import { aliyunSmsConfigGuard, sendSmsResponseGuard } from './types.js'; | |||
|
|||
const isChinaNumber = (to: string) => /^(\+86|0086|86)?\d{11}$/.test(to); | |||
const isChinaNumber = (to: string) => /^(\+86|0086|86)\d{11}$/.test(to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@logto-io/eng can you guys take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the existing data may not have country code prefix, hold this PR until we have a plan for migration.
This PR is stale because it has been open 10 for days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Hi @glzjin, after discussion, we think it is better to provider a switch config, to let the user to decide how to treat the numbers without country code. Would you mind adding a config in the "formItems"? |
This PR is stale because it has been open 10 for days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Summary
Correctly identify Chinese mobile numbers to prevent US mobile numbers from being classified as Chinese mobile numbers.
Testing
Checklist
.changeset