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:
parent
b80934ac5c
commit
19d322a6c8
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ import { sendSms } from './single-send-text.js';
|
||||||
import type { Template } from './types.js';
|
import type { Template } from './types.js';
|
||||||
import { aliyunSmsConfigGuard, sendSmsResponseGuard } 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) => {
|
const getTemplateCode = ({ templateCode }: Template, to: string) => {
|
||||||
if (typeof templateCode === 'string') {
|
if (typeof templateCode === 'string') {
|
||||||
|
|
Loading…
Reference in a new issue