diff --git a/src/org/scratchOrgInfoApi.ts b/src/org/scratchOrgInfoApi.ts index c8fdfe893c..57b46d7855 100644 --- a/src/org/scratchOrgInfoApi.ts +++ b/src/org/scratchOrgInfoApi.ts @@ -232,7 +232,11 @@ export const authorizeScratchOrg = async (options: { clientId: scratchOrgInfoComplete.ConnectedAppConsumerKey, createdOrgInstance: scratchOrgInfoComplete.SignupInstance, isDevHub: false, - snapshot: scratchOrgInfoComplete.Snapshot, + isScratch: true, + isSandbox: false, + // omit optional fields unless they are present + ...(scratchOrgInfoComplete.Namespace ? { namespacePrefix: scratchOrgInfoComplete.Namespace } : {}), + ...(scratchOrgInfoComplete.Snapshot ? { snapshot: scratchOrgInfoComplete.Snapshot } : {}), }); return authInfo;