This commit is contained in:
Luiz H. R. Silva 2024-06-04 13:00:36 -03:00
parent 645b3b551e
commit e30a1a6f40
16 changed files with 346 additions and 8 deletions

View file

@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pAutenticacao = void 0;
const _comuns_1 = require("~comuns");
const respostas_1 = require("./respostas");
const urlAutenticacao = (ambiente) => `${ambiente == "producao"
? "https://carro-de-boi.idz.one"
: "http://localhost:5030"}/autenticacao`;
@ -21,11 +21,11 @@ const validarToken = async ({ ambiente, post, buscar, }) => {
const codigoContaSite = async ({ ambiente, post, buscar, }) => {
const url = `${urlAutenticacao(ambiente)}/autenticacao/api/codigo_prefeitura_site`;
try {
const resp = await buscar(url, post).catch((e) => _comuns_1.respostaComuns.erro(`erro ao buscar código do site: ${e}`));
const resp = await buscar(url, post).catch((e) => respostas_1.respostaComuns.erro(`erro ao buscar código do site: ${e}`));
return resp;
}
catch (e) {
return _comuns_1.respostaComuns.erro(`erro ao buscar código do site: ${e}`);
return respostas_1.respostaComuns.erro(`erro ao buscar código do site: ${e}`);
}
};
/** todas as rotas de comunicação com autenticador partem dessa variável */