Skip to content

Commit 082b1c6

Browse files
authored
fix: postMessage must send a Credential that is usable by JSSDK (Esri#1223)
1 parent 591b339 commit 082b1c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/arcgis-rest-request/src/ArcGISIdentityManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ export class ArcGISIdentityManager
13171317
if (isValidOrigin && isValidType) {
13181318
let msg = {};
13191319
if (isTokenValid) {
1320-
const credential = this.toJSON();
1320+
const credential = this.toCredential();
13211321
msg = {
13221322
type: "arcgis:auth:credential",
13231323
credential

packages/arcgis-rest-request/test/ArcGISIdentityManager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,7 @@ describe("ArcGISIdentityManager", () => {
18801880
"arcgis:auth:credential",
18811881
"should send credential type"
18821882
);
1883-
expect(args[0].credential.username).toBe(
1883+
expect(args[0].credential.userId).toBe(
18841884
"jsmith",
18851885
"should send credential"
18861886
);

0 commit comments

Comments
 (0)