Created
July 8, 2018 22:14
-
-
Save jason-dark/93597057486941ae18aa81ac7550243c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsforce = require('jsforce'); | |
var username = "XXXXXXXXXXXXXXXXX"; | |
var password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
function sfAuth() { | |
return new Promise((resolve, reject) => { | |
console.log("✔ Connecting to Salesforce"); | |
var conn = new jsforce.Connection({ | |
loginUrl: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
}); | |
conn.login(username, password, (e, userInfo) => { | |
if (e) { | |
console.log(e); | |
reject(e); | |
} else { | |
console.log("✔ Connection successful"); | |
resolve(conn); | |
} | |
}); | |
}) | |
} | |
module.exports = sfAuth; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment