mirror of
https://github.com/tribufu/tribufu-js
synced 2026-06-01 09:42:36 +00:00
Update client.ts
This commit is contained in:
parent
86abc9877e
commit
7c22788be4
1 changed files with 3 additions and 4 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
import { HttpCookieMap, HttpHeaders } from "@tribufu/mintaka";
|
import { HttpCookieMap, HttpHeaders } from "@tribufu/mintaka";
|
||||||
import { OAuth2GrantType, OAuth2IntrospectionRequest, OAuth2IntrospectionResponse, OAuth2TokenRequest, OAuth2TokenResponse } from "@tribufu/mintaka";
|
import { OAuth2GrantType, OAuth2IntrospectionRequest, OAuth2IntrospectionResponse, OAuth2TokenRequest, OAuth2TokenResponse } from "@tribufu/mintaka";
|
||||||
import { TribufuApi } from "./api";
|
import { TribufuApi } from "./api";
|
||||||
import { User } from "./models/user";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **Tribufu Client**
|
* **Tribufu Client**
|
||||||
|
|
@ -337,7 +336,7 @@ export class TribufuClient extends TribufuApi {
|
||||||
* Get information about the current client.
|
* Get information about the current client.
|
||||||
* @returns Client | null
|
* @returns Client | null
|
||||||
*/
|
*/
|
||||||
public async getClientInfo(): Promise<User | null> {
|
public async getClientInfo(): Promise<any | null> {
|
||||||
return this.getClientById(this.clientId);
|
return this.getClientById(this.clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -345,13 +344,13 @@ export class TribufuClient extends TribufuApi {
|
||||||
* Get information about the current user.
|
* Get information about the current user.
|
||||||
* @returns User | null
|
* @returns User | null
|
||||||
*/
|
*/
|
||||||
public async getUserInfo(): Promise<User | null> {
|
public async getUserInfo(): Promise<any | null> {
|
||||||
if (!this.options.accessToken) {
|
if (!this.options.accessToken) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const headers = this.getHeaders();
|
const headers = this.getHeaders();
|
||||||
const responseBody = await this.http.get<User>(`/v1/oauth2/userinfo`, headers);
|
const responseBody = await this.http.get<any>(`/v1/oauth2/userinfo`, headers);
|
||||||
|
|
||||||
if (!responseBody) {
|
if (!responseBody) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue