<?php
require_once __DIR__.'/../../_bootstrap.php';
$u=apiUsuario($pdo);$uid=(int)$u['id'];
if($_SERVER['REQUEST_METHOD']!=='POST')jsonResponse(['ok'=>false,'erro'=>'Método não permitido.'],405);
$d=requestJson();
try{jsonResponse(['ok'=>true,'delivery'=>afGuardianSendVerificationCode($pdo,$uid,(string)($d['channel']??'email'))]);}
catch(Throwable $e){jsonResponse(['ok'=>false,'erro'=>$e->getMessage()],422);}
