File tree Expand file tree Collapse file tree 2 files changed +676
-670
lines changed
src/commands/agent/publish Expand file tree Collapse file tree 2 files changed +676
-670
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishA
103103 const targetOrg = flags [ 'target-org' ] ;
104104 const conn = targetOrg . getConnection ( flags [ 'api-version' ] ) ;
105105
106+ // Preserve the original accessToken by storing its value
107+ const originalAccessToken = conn . accessToken ;
108+
106109 // First compile the .agent file to get the Agent JSON
107110 const compileResponse = await Agent . compileAgentScript (
108111 conn ,
@@ -133,6 +136,9 @@ export default class AgentPublishAuthoringBundle extends SfCommand<AgentPublishA
133136 }
134137 return Promise . resolve ( ) ;
135138 } ) ;
139+
140+ // Restore the original accessToken after compilation
141+ conn . accessToken = originalAccessToken ;
136142 const result = await Agent . publishAgentJson ( conn , this . project ! , compileResponse . compiledArtifact ) ;
137143 mso . stop ( ) ;
138144
You can’t perform that action at this time.
0 commit comments