سامانه صدور فاکتور و حسابداری
fix: validate E.164 phone syntax with correct escaped plus
davoodmehraban89 committed
Oct 11, 2026 at 20:39 UTC
555df9e6bb9d9ed20f2f5092e4cda43bbeb25628
1 file changed
+1
-1
supabase/functions/admin-user-management/index.ts
+1
-1
@@ -58,7 +58,7 @@ Deno.serve(async (request: Request) => {
58
const fullName=String(body.full_name||"").trim();
59
const username=String(body.username||"").trim().toLowerCase();
60
const password=String(body.temporary_password||"");
61
- if((!email&&!phone)||(email&&!validEmail(email))||(phone&&!/^\\+[1-9][0-9]{7,14}$/.test(phone)))return reply(400,{error:"invalid_email_or_phone"},origin);
61
+ if((!email&&!phone)||(email&&!validEmail(email))||(phone&&!/^\+[1-9][0-9]{7,14}$/.test(phone)))return reply(400,{error:"invalid_email_or_phone"},origin);
62
if(fullName.length>120||username && !/^[a-z0-9_.-]{3,40}$/.test(username))return reply(400,{error:"invalid_profile"},origin);
63
if(!strongPassword(password))return reply(400,{error:"weak_temporary_password"},origin);
64
const credentials=email?{email,email_confirm:true}:{phone,phone_confirm:true};