convertido para pnpm
This commit is contained in:
parent
59e710f6cf
commit
175d767d27
115 changed files with 2366 additions and 1451 deletions
22
dist-front/autenticacao/_validarToken.js
Normal file
22
dist-front/autenticacao/_validarToken.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue