roboto-js 1.3.7 → 1.3.9

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.
@@ -165,23 +165,24 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
165
165
  this.currentUser = this.iac_session ? new _rbt_user["default"](this.iac_session.user, this.axios) : null;
166
166
  // update axios instance headers with authtoken
167
167
  this.axios.defaults.headers.common['authtoken'] = response.data.authToken;
168
+ this.authtoken = response.data.authToken;
168
169
  if (!this.localStorageAdaptor) {
169
- _context3.next = 13;
170
+ _context3.next = 14;
170
171
  break;
171
172
  }
172
- _context3.next = 13;
173
+ _context3.next = 14;
173
174
  return this.localStorageAdaptor.setItem('authtoken', response.data.authToken);
174
- case 13:
175
+ case 14:
175
176
  return _context3.abrupt("return", response.data);
176
- case 16:
177
- _context3.prev = 16;
177
+ case 17:
178
+ _context3.prev = 17;
178
179
  _context3.t0 = _context3["catch"](0);
179
180
  this._handleError(_context3.t0);
180
- case 19:
181
+ case 20:
181
182
  case "end":
182
183
  return _context3.stop();
183
184
  }
184
- }, _callee3, this, [[0, 16]]);
185
+ }, _callee3, this, [[0, 17]]);
185
186
  }));
186
187
  function login(_x2) {
187
188
  return _login.apply(this, arguments);
@@ -210,28 +211,29 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
210
211
  // Clear the iac_session and remove the auth token from axios headers
211
212
  this.iac_session = null;
212
213
  this.currentUser = null;
214
+ this.authtoken = null;
213
215
  if (this.axios.defaults.headers.common['authtoken']) {
214
216
  delete this.axios.defaults.headers.common['authtoken'];
215
217
  }
216
218
 
217
219
  // Clear localStorage if it's being used
218
220
  if (!this.localStorageAdaptor) {
219
- _context4.next = 12;
221
+ _context4.next = 13;
220
222
  break;
221
223
  }
222
- _context4.next = 12;
224
+ _context4.next = 13;
223
225
  return this.localStorageAdaptor.removeItem('authtoken');
224
- case 12:
226
+ case 13:
225
227
  return _context4.abrupt("return", response.data);
226
- case 15:
227
- _context4.prev = 15;
228
+ case 16:
229
+ _context4.prev = 16;
228
230
  _context4.t0 = _context4["catch"](0);
229
231
  this._handleError(_context4.t0);
230
- case 18:
232
+ case 19:
231
233
  case "end":
232
234
  return _context4.stop();
233
235
  }
234
- }, _callee4, this, [[0, 15]]);
236
+ }, _callee4, this, [[0, 16]]);
235
237
  }));
236
238
  function logout() {
237
239
  return _logout.apply(this, arguments);
@@ -83,6 +83,7 @@ export default class RbtApi {
83
83
  this.currentUser = this.iac_session ? new RbtUser(this.iac_session.user, this.axios) : null;
84
84
  // update axios instance headers with authtoken
85
85
  this.axios.defaults.headers.common['authtoken'] = response.data.authToken;
86
+ this.authtoken = response.data.authToken;
86
87
  if (this.localStorageAdaptor) {
87
88
  await this.localStorageAdaptor.setItem('authtoken', response.data.authToken);
88
89
  }
@@ -103,6 +104,7 @@ export default class RbtApi {
103
104
  // Clear the iac_session and remove the auth token from axios headers
104
105
  this.iac_session = null;
105
106
  this.currentUser = null;
107
+ this.authtoken = null;
106
108
  if (this.axios.defaults.headers.common['authtoken']) {
107
109
  delete this.axios.defaults.headers.common['authtoken'];
108
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/rbt_api.js CHANGED
@@ -96,7 +96,8 @@ export default class RbtApi {
96
96
  this.currentUser = (this.iac_session)? new RbtUser(this.iac_session.user, this.axios): null;
97
97
  // update axios instance headers with authtoken
98
98
  this.axios.defaults.headers.common['authtoken'] = response.data.authToken;
99
-
99
+ this.authtoken = response.data.authToken;
100
+
100
101
  if(this.localStorageAdaptor){
101
102
  await this.localStorageAdaptor.setItem('authtoken', response.data.authToken);
102
103
  }
@@ -121,6 +122,7 @@ export default class RbtApi {
121
122
  // Clear the iac_session and remove the auth token from axios headers
122
123
  this.iac_session = null;
123
124
  this.currentUser = null;
125
+ this.authtoken = null;
124
126
  if (this.axios.defaults.headers.common['authtoken']) {
125
127
  delete this.axios.defaults.headers.common['authtoken'];
126
128
  }