diff --git a/packages/miniapp/src/Authing.ts b/packages/miniapp/src/Authing.ts index 25770c7c..ff3b176e 100644 --- a/packages/miniapp/src/Authing.ts +++ b/packages/miniapp/src/Authing.ts @@ -31,7 +31,8 @@ import { GetAccessTokenOptions, UpdateEmailRequestOptions, UpdatePhoneRequestOptions, - DeleteAccountRequestOptions + DeleteAccountRequestOptions, + GerUserInfo } from './types' import { returnSuccess, returnError } from './helpers/return' @@ -511,7 +512,11 @@ export class Authing { return returnSuccess(updatePasswordRes) } - async getUserInfo(): Promise> { + async getUserInfo(data: GerUserInfo = { + withCustomData: false, + withDepartmentIds: false, + withIdentities: false + }): Promise> { const [error, loginState] = await this.getLoginState() if (error) { @@ -534,7 +539,8 @@ export class Authing { header: { 'x-authing-userpool-id': this.options.userPoolId, Authorization: access_token - } + }, + data }) if (getProfileError) { diff --git a/packages/miniapp/src/types.ts b/packages/miniapp/src/types.ts index 0ce1410c..00882374 100644 --- a/packages/miniapp/src/types.ts +++ b/packages/miniapp/src/types.ts @@ -476,3 +476,9 @@ export interface ErrorData { statusCode?: number apiCode?: number } + +export interface GerUserInfo { + withDepartmentIds?: boolean + withCustomData?: boolean + withIdentities?: boolean +} \ No newline at end of file