roboto-js 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
32
32
  accesskey = _ref.accesskey;
33
33
  _classCallCheck(this, RbtApi);
34
34
  var isClient = typeof window !== 'undefined';
35
- var authTokenToUse = isClient && !authtoken ? localStorage.getItem('authtoken') : authtoken;
35
+ var authTokenToUse = isClient && !authtoken && typeof localStorage != 'undefined' ? localStorage.getItem('authtoken') : authtoken;
36
36
  this.axios = _axios["default"].create({
37
37
  baseURL: baseUrl,
38
38
  headers: {
@@ -13,7 +13,7 @@ export default class RbtApi {
13
13
  accesskey
14
14
  }) {
15
15
  const isClient = typeof window !== 'undefined';
16
- const authTokenToUse = isClient && !authtoken ? localStorage.getItem('authtoken') : authtoken;
16
+ const authTokenToUse = isClient && !authtoken && typeof localStorage != 'undefined' ? localStorage.getItem('authtoken') : authtoken;
17
17
  this.axios = axios.create({
18
18
  baseURL: baseUrl,
19
19
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/rbt_api.js CHANGED
@@ -11,7 +11,7 @@ export default class RbtApi {
11
11
  constructor({ apiKey, baseUrl, authtoken, accesskey }) {
12
12
 
13
13
  const isClient = typeof window !== 'undefined';
14
- const authTokenToUse = isClient && !authtoken ? localStorage.getItem('authtoken') : authtoken;
14
+ const authTokenToUse = isClient && !authtoken && typeof localStorage != 'undefined' ? localStorage.getItem('authtoken') : authtoken;
15
15
 
16
16
  this.axios = axios.create({
17
17
  baseURL: baseUrl,