Skip to content

Commit 327a7b2

Browse files
committed
fix: pass payloadsize to checkBatchFlow endpoint
Ticket: WP-7566
1 parent effaa5f commit 327a7b2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

modules/sdk-api/src/bitgoAPI.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,9 +1932,15 @@ export class BitGoAPI implements BitGoBase {
19321932
password: this.calculateHMAC(user.username, newPassword),
19331933
};
19341934

1935+
// Calculate payload size in KB
1936+
const payloadSizeBytes = JSON.stringify(updatePasswordParams).length;
1937+
const payloadSizeKB = Math.ceil(payloadSizeBytes / 1024);
1938+
19351939
// Check if batching flow is enabled
19361940
try {
1937-
const batchingFlowCheck = await this.get(this.url('/user/checkBatchingPasswordFlow', 2)).result();
1941+
const batchingFlowCheck = await this.get(this.url('/user/checkBatchingPasswordFlow', 2))
1942+
.query({ payloadSize: payloadSizeKB.toString() })
1943+
.result();
19381944

19391945
if (batchingFlowCheck.isBatchingFlowEnabled) {
19401946
await this.processKeychainPasswordUpdatesInBatches(

0 commit comments

Comments
 (0)