import node_fetch from "cross-fetch"; const validarToken = async ({ url_api_autenticacao, post }) => { const url = `${url_api_autenticacao}/api/validar_token`; try { const resposta = await node_fetch(url, { method: "POST", body: JSON.stringify(post), headers: { "Content-Type": "application/json" } }).then((r) => r.json()).then((r) => r).then( (resposta2) => resposta2.eCerto ? "valido" : "erro" ).catch(() => "erro"); return resposta; } catch (_e) { return "erro"; } }; export { validarToken };