Skip to content

Commit d9be56b

Browse files
authored
!fix: make AM auth token optional (#45)
BREAKING CHANGE: incorrectly typed Update interface on the UserAuthenticationPasswordProfileEndpoint class
1 parent ce9a86a commit d9be56b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/endpoints/user-authentication-password-profile.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class UserAuthenticationPasswordProfileEndpoint extends CRUDExtend {
6363
userAuthenticationInfoId,
6464
userAuthenticationPasswordProfileId,
6565
body,
66-
accountManagementAuthenticationToken,
67-
token = null
66+
token = null,
67+
accountManagementAuthenticationToken = null
6868
) {
6969
return this.request.send(
7070
`${this.endpoint
@@ -79,10 +79,12 @@ class UserAuthenticationPasswordProfileEndpoint extends CRUDExtend {
7979
this,
8080
true,
8181
'v2',
82-
{
83-
'EP-Account-Management-Authentication-Token':
84-
accountManagementAuthenticationToken
85-
}
82+
accountManagementAuthenticationToken
83+
? {
84+
'EP-Account-Management-Authentication-Token':
85+
accountManagementAuthenticationToken
86+
}
87+
: {}
8688
)
8789
}
8890

src/types/user-authentication-password-profile.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export interface UserAuthenticationPasswordProfileEndpoint {
101101
userAuthenticationInfoId: string,
102102
userAuthenticationPasswordProfileId: string,
103103
body: { data: UserAuthenticationPasswordProfileUpdateBody },
104-
accountManagementAuthenticationToken: string,
105-
token?: string
104+
token?: string | null,
105+
accountManagementAuthenticationToken?: string | null
106106
): Promise<UserAuthenticationPasswordProfileResponse>
107107

108108
/**

test/unit/user-authentication-password-profile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ describe('User Authentication Password Profile Info', () => {
8989
{
9090
data: body
9191
},
92+
null,
9293
'dummy-token'
9394
).then(res => {
9495
assert.isObject(res)

0 commit comments

Comments
 (0)