Skip to content

Commit 3f2a277

Browse files
authored
Merge branch 'develop' into W-20450671-bug-fix-landingPath-not-set-by-config
2 parents c616f55 + 7faf699 commit 3f2a277

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/commerce-sdk-react/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## v4.4.0-dev (Dec 17, 2025)
2+
- [Bugfix]Ensure code_verifier can be optional in resetPassword call [#3567](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3567)
23

34
## v4.3.0 (Dec 17, 2025)
45

packages/commerce-sdk-react/src/auth/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,12 +1361,18 @@ class Auth {
13611361
Authorization: ''
13621362
},
13631363
body: {
1364+
// TODO: remove the eslint disabled after updating OAS
1365+
// user_id is a valid param for resetPassword
1366+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1367+
// @ts-ignore
1368+
...(parameters.user_id && {user_id: parameters.user_id}),
13641369
pwd_action_token: parameters.pwd_action_token,
13651370
channel_id: parameters.channel_id || slasClient.clientConfig.parameters.siteId,
13661371
client_id: parameters.client_id || slasClient.clientConfig.parameters.clientId,
13671372
new_password: parameters.new_password,
1368-
hint: parameters.hint,
1369-
code_verifier: parameters.code_verifier
1373+
hint: parameters.hint || 'cross_device',
1374+
// hint='cross_device' and a defined user_id is required for code_verifier to be optional for this call
1375+
...(parameters.code_verifier && {code_verifier: parameters.code_verifier})
13701376
}
13711377
}
13721378

@@ -1376,9 +1382,6 @@ class Auth {
13761382
`${slasClient.clientConfig.parameters.clientId}:${this.clientSecret}`
13771383
)}`
13781384
}
1379-
// TODO: no code verifier needed with the fix blair has made, delete this when the fix has been merged to production
1380-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1381-
// @ts-ignore
13821385
const res = await this.client.resetPassword(options)
13831386
return res
13841387
}

0 commit comments

Comments
 (0)