diff --git a/src/api/Launchpad.js b/src/api/Launchpad.js index 8a62cac..391eee0 100644 --- a/src/api/Launchpad.js +++ b/src/api/Launchpad.js @@ -1,6 +1,6 @@ 'use strict'; -import Auth from '../api/Auth'; +import Auth from './Auth'; import Embodied from '../api-query/Embodied'; import Filter from '../api-query/Filter'; import Query from '../api-query/Query'; @@ -415,7 +415,15 @@ class Launchpad { clientRequest.header('Authorization', 'Bearer ' + this.auth_.token()); } else { var credentials = this.auth_.username() + ':' + this.auth_.password(); - clientRequest.header('Authorization', 'Basic ' + btoa(credentials)); + var basic; + + if (typeof btoa === 'function') { + basic = btoa(credentials); + } else { + basic = new Buffer(credentials.toString(), 'binary'); + } + + clientRequest.header('Authorization', 'Basic ' + basic); } }