Closed kterusaki closed 8 years ago
I'm not sure what you mean by org.auth
. There is never a property called org.auth
. org.oauth
is the property used to store internal oauth credentials for single user mode.
Connection properties: https://github.com/kevinohara80/nforce/blob/master/index.js#L41
The instance_url
error that you are experiencing is usually caused from missing oauth credentials. In single user mode, when you call authenticate()
and the auth succeeds, the oauth information is automatically stored internally. If you are creating a new connection object but already have oauth credentials that you want to use, you need to set them with the setOAuth()
method like so...
var org = nforce.createConnection({
mode: 'single',
...
});
org.setOAuth(myoauth);
You can also set it as a property in the createConnection
options...
var org = nforce.createConnection({
mode: 'single',
oauth: myoauth
...
});
More on the OAuth object: https://github.com/kevinohara80/nforce#oauth-object
Let me know if that makes sense.
Is there any particular reasoning for the different naming convention depending on which mode you are using?
It would convenient if it was one or the other for either mode. I was accessing the instance_url property in the org.auth object, but I switched from multi mode to single mode which threw an error in my code.