build
This commit is contained in:
parent
43616225e7
commit
7e7fbb6809
17 changed files with 159 additions and 18 deletions
17
dist-import/autenticacao.js
Normal file
17
dist-import/autenticacao.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/** retorna uma url e os parametros que devem ser enviádos */
|
||||
const urlValidarToken = async ({ ambiente, post, buscar, }) => {
|
||||
const url = `${ambiente == "producao"
|
||||
? "https://carro-de-boi.idz.one"
|
||||
: "http://localhost:5030"}/autenticacao/api/validar_token`;
|
||||
try {
|
||||
const resposta = await buscar(url, post)
|
||||
.then((resposta) => resposta.eCerto ? "valido" : "erro")
|
||||
.catch((e) => "erro");
|
||||
return resposta;
|
||||
}
|
||||
catch (e) {
|
||||
return "erro";
|
||||
}
|
||||
};
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
export const pAutenticacao = { urlValidarToken };
|
||||
Loading…
Add table
Add a link
Reference in a new issue