Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/commands/agent/publish/authoring-bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishA
const targetOrg = flags['target-org'];
const conn = targetOrg.getConnection(flags['api-version']);

// Preserve the original accessToken by storing its value
const originalAccessToken = conn.accessToken;

// First compile the .agent file to get the Agent JSON
const compileResponse = await Agent.compileAgentScript(
conn,
Expand Down Expand Up @@ -133,6 +136,9 @@ export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishA
}
return Promise.resolve();
});

// Restore the original accessToken after compilation
conn.accessToken = originalAccessToken;
const result = await Agent.publishAgentJson(conn, this.project!, compileResponse.compiledArtifact);
mso.stop();

Expand Down
Loading
Loading