Pipe output from forked processes back to parent.

Also cleaned up the code a bit. Switched to use lambda declarations in promises and renamed 'fulfill' to 'resolve', as it should be,
This commit is contained in:
Daniel Scalzi
2018-05-07 18:15:59 -04:00
parent 0c1ebd0ce0
commit cd4f7918c8
5 changed files with 84 additions and 73 deletions

View File

@@ -24,7 +24,7 @@ const Mojang = require('./mojang.js')
* @returns {Promise.<Object>} Promise which resolves the resolved authenticated account object.
*/
exports.addAccount = async function(username, password){
try{
try {
const session = await Mojang.authenticate(username, password, ConfigManager.getClientToken)
const ret = ConfigManager.addAuthAccount(session.selectedProfile.id, session.accessToken, username, session.selectedProfile.name)
ConfigManager.save()