bug: Aliyun SMS Connector incorrectly identifies a Hong Kong mobile phone...
Identity infrastructure for developers, Auth0 open source alternative
Brought to you by:
fleuraly
Originally created by: codehz
Originally owned by: xiaoyijun
Aliyun SMS Connector incorrectly identifies a Hong Kong mobile phone number as a mainland Chinese mobile phone number
send message to HK mobile successfully
generate a dummy 852 phone number, like 85268326366
try to register with this number
I think the problem is
https://github.com/logto-io/logto/blob/76fd33b7ed460a1a633f594810f4859dd834304d/packages/connectors/connector-aliyun-sms/src/index.ts#L23
HK number is exactly 11 digits...
Originally posted by: xiaoyijun
Hi @codehz thanks for your report, this is a known issue, and we're exploring a appropriate solution. Will keep you posted.
Originally posted by: codehz
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}$/)