"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.validarToken = void 0; const cross_fetch_1 = __importDefault(require("cross-fetch")); /** faz a validação do token */ const validarToken = async ({ url_api_autenticacao, post, }) => { const url = `${url_api_autenticacao}/api/validar_token`; try { const resposta = await (0, cross_fetch_1.default)(url, { method: "POST", body: JSON.stringify(post), headers: { "Content-Type": "application/json" }, }) .then((r) => r.json()) .then((r) => r) .then((resposta) => resposta.eCerto ? "valido" : "erro") .catch(() => "erro"); return resposta; } catch (_e) { return "erro"; } }; exports.validarToken = validarToken;