melhorias em validar token

This commit is contained in:
Luiz Silva 2025-11-18 15:10:17 -03:00
parent e0a492f7d2
commit 947ffdc815
6 changed files with 13 additions and 16 deletions

View file

@ -31,6 +31,7 @@ __export(validarToken_exports, {
validarToken: () => validarToken
});
module.exports = __toCommonJS(validarToken_exports);
var import_p_respostas = require("p-respostas");
var import_cross_fetch = __toESM(require("cross-fetch"));
var import_site_autenticacao = require("../utilitarios/site_autenticacao");
const validarToken = async ({
@ -43,12 +44,10 @@ const validarToken = async ({
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");
}).then((r) => r.json()).then((r) => r).catch((err) => import_p_respostas.respostaComuns.erro(`Erro: ${err.message}`));
return resposta;
} catch (_e) {
return "erro";
} catch (err) {
return import_p_respostas.respostaComuns.erro(`Erro: ${err.message}`);
}
};
// Annotate the CommonJS export names for ESM import in node: