tipoUsuarioTokenAutneticacao
This commit is contained in:
parent
947ffdc815
commit
264d126a14
5 changed files with 6 additions and 5 deletions
|
|
@ -39,7 +39,7 @@ declare const pAutenticacao: {
|
||||||
post: {
|
post: {
|
||||||
token: string;
|
token: string;
|
||||||
};
|
};
|
||||||
}) => Promise<p_respostas.tipoResposta<string>>;
|
}) => Promise<p_respostas.tipoResposta<tipoUsuarioTokenAutneticacao>>;
|
||||||
codigoContaSite: ({ base_url_autenticacao, post, }: {
|
codigoContaSite: ({ base_url_autenticacao, post, }: {
|
||||||
base_url_autenticacao: string;
|
base_url_autenticacao: string;
|
||||||
post: {
|
post: {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-autenticacao-drive",
|
"name": "p-autenticacao-drive",
|
||||||
"version": "1.46.0",
|
"version": "1.47.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
||||||
BIN
pacote.tgz
BIN
pacote.tgz
Binary file not shown.
|
|
@ -3,6 +3,7 @@ import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||||
type tipoPostValidarTokem = { token: string }
|
type tipoPostValidarTokem = { token: string }
|
||||||
|
|
||||||
import node_fetch from "cross-fetch"
|
import node_fetch from "cross-fetch"
|
||||||
|
import type { tipoUsuarioTokenAutneticacao } from "../tokens"
|
||||||
import { site_autenticacao } from "../utilitarios/site_autenticacao"
|
import { site_autenticacao } from "../utilitarios/site_autenticacao"
|
||||||
|
|
||||||
/** faz a validação do token */
|
/** faz a validação do token */
|
||||||
|
|
@ -12,7 +13,7 @@ export const validarToken = async ({
|
||||||
}: {
|
}: {
|
||||||
base_url_autenticacao: string
|
base_url_autenticacao: string
|
||||||
post: tipoPostValidarTokem
|
post: tipoPostValidarTokem
|
||||||
}): Promise<tipoResposta<string>> => {
|
}): Promise<tipoResposta<tipoUsuarioTokenAutneticacao>> => {
|
||||||
const url = `${site_autenticacao(base_url_autenticacao)}/api/validar_token`
|
const url = `${site_autenticacao(base_url_autenticacao)}/api/validar_token`
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -22,7 +23,7 @@ export const validarToken = async ({
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
})
|
})
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((r) => r as tipoResposta<any>)
|
.then((r) => r as tipoResposta<tipoUsuarioTokenAutneticacao>)
|
||||||
|
|
||||||
.catch((err) => respostaComuns.erro(`Erro: ${(err as Error).message}`))
|
.catch((err) => respostaComuns.erro(`Erro: ${(err as Error).message}`))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue