0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

Fix: Correctly identify Chinese mobile numbers to prevent US mobile numbers from being classified as Chinese mobile numbers.

This commit is contained in:
glzjin 2024-04-28 09:42:02 +08:00 committed by GitHub
parent b80934ac5c
commit 19d322a6c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
const getTemplateCode = ({ templateCode }: Template, to: string) => {
if (typeof templateCode === 'string') {