Skip to content

Commit d9173d2

Browse files
feat(miniapp): add params for getUserInfo
1 parent 804f32b commit d9173d2

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/miniapp/src/Authing.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import {
3131
GetAccessTokenOptions,
3232
UpdateEmailRequestOptions,
3333
UpdatePhoneRequestOptions,
34-
DeleteAccountRequestOptions
34+
DeleteAccountRequestOptions,
35+
GerUserInfo
3536
} from './types'
3637

3738
import { returnSuccess, returnError } from './helpers/return'
@@ -511,7 +512,11 @@ export class Authing {
511512
return returnSuccess(updatePasswordRes)
512513
}
513514

514-
async getUserInfo(): Promise<SDKResponse<UserInfo>> {
515+
async getUserInfo(data: GerUserInfo = {
516+
withCustomData: false,
517+
withDepartmentIds: false,
518+
withIdentities: false
519+
}): Promise<SDKResponse<UserInfo>> {
515520
const [error, loginState] = await this.getLoginState()
516521

517522
if (error) {
@@ -534,7 +539,8 @@ export class Authing {
534539
header: {
535540
'x-authing-userpool-id': this.options.userPoolId,
536541
Authorization: access_token
537-
}
542+
},
543+
data
538544
})
539545

540546
if (getProfileError) {

packages/miniapp/src/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,3 +476,9 @@ export interface ErrorData {
476476
statusCode?: number
477477
apiCode?: number
478478
}
479+
480+
export interface GerUserInfo {
481+
withDepartmentIds?: boolean
482+
withCustomData?: boolean
483+
withIdentities?: boolean
484+
}

0 commit comments

Comments
 (0)