tipoUsuarioTokenAutneticacao
This commit is contained in:
parent
947ffdc815
commit
264d126a14
5 changed files with 6 additions and 5 deletions
|
|
@ -3,6 +3,7 @@ import { respostaComuns, type tipoResposta } from "p-respostas"
|
|||
type tipoPostValidarTokem = { token: string }
|
||||
|
||||
import node_fetch from "cross-fetch"
|
||||
import type { tipoUsuarioTokenAutneticacao } from "../tokens"
|
||||
import { site_autenticacao } from "../utilitarios/site_autenticacao"
|
||||
|
||||
/** faz a validação do token */
|
||||
|
|
@ -12,7 +13,7 @@ export const validarToken = async ({
|
|||
}: {
|
||||
base_url_autenticacao: string
|
||||
post: tipoPostValidarTokem
|
||||
}): Promise<tipoResposta<string>> => {
|
||||
}): Promise<tipoResposta<tipoUsuarioTokenAutneticacao>> => {
|
||||
const url = `${site_autenticacao(base_url_autenticacao)}/api/validar_token`
|
||||
|
||||
try {
|
||||
|
|
@ -22,7 +23,7 @@ export const validarToken = async ({
|
|||
headers: { "Content-Type": "application/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}`))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue