diff --git a/lib/auth.js b/lib/auth.js index 9d5fa05..8d13189 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -330,7 +330,8 @@ const authClient = new Model({ var deleteHeaders = { ...config.jsonHeaders, - ['X-CSRF-Token']: token + ['X-CSRF-Token']: token, + ['Authorization']: 'Bearer ' + this._bearerToken }; return makeCredentialHTTPRequest('DELETE', url, null, deleteHeaders) diff --git a/lib/oauth.js b/lib/oauth.js index cd1e798..0d407e2 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -131,6 +131,10 @@ const authClient = new Model({ ['X-CSRF-Token']: token }; + if (this._tokenDetails && this._tokenDetails.access_token) { + deleteHeaders['Authorization'] = 'Bearer ' + this._tokenDetails.access_token + } + return makeCredentialHTTPRequest('DELETE', url, null, deleteHeaders) .then(function() { this._deleteBearerToken();