jscrambler
Advanced tools
Comparing version 5.3.5 to 5.3.8
@@ -111,11 +111,17 @@ 'use strict'; | ||
var signedData = void 0; | ||
if (this.token) { | ||
params.token = this.token; | ||
if (this.options.useHeaderAuth) { | ||
if (!this.token) { | ||
throw new Error('Generating auth token when useHeaderAuth === true is not yet supported. You need to set the jscramblerClient token property explicitly.'); | ||
} | ||
} else { | ||
if (!this.options.keys.accessKey) { | ||
throw new Error('Required *accessKey* not provided'); | ||
} | ||
if (this.token) { | ||
params.token = this.token; | ||
} else { | ||
if (!this.options.keys.accessKey) { | ||
throw new Error('Required *accessKey* not provided'); | ||
} | ||
if (!this.options.keys.secretKey) { | ||
throw new Error('Required *secretKey* not provided'); | ||
if (!this.options.keys.secretKey) { | ||
throw new Error('Required *secretKey* not provided'); | ||
} | ||
} | ||
@@ -225,2 +231,20 @@ } | ||
var _token = void 0; | ||
Object.defineProperty(JScramblerClient.prototype, 'token', { | ||
get: function get() { | ||
return _token; | ||
}, | ||
set: function set(value) { | ||
_token = value; | ||
if (value) { | ||
if (this.options.useHeaderAuth) { | ||
this.axiosInstance.defaults.headers['x-user-authentication'] = _token; | ||
} | ||
} else { | ||
delete this.axiosInstance.defaults.headers['x-user-authentication']; | ||
} | ||
} | ||
}); | ||
exports = module.exports = JScramblerClient; |
{ | ||
"name": "jscrambler", | ||
"description": "Jscrambler API client.", | ||
"version": "5.3.5", | ||
"version": "5.3.8", | ||
"homepage": "https://github.com/jscrambler/jscrambler", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
225100
31
5238
18
2