@evergis/api 3.0.202 → 3.0.203

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.
@@ -1437,18 +1437,18 @@ let Account = /*#__PURE__*/function (_AccountService) {
1437
1437
 
1438
1438
  _createClass(Account, [{
1439
1439
  key: "login",
1440
- value: function login(params, authParams) {
1440
+ value: async function login(params, authParams) {
1441
1441
  if (authParams === void 0) {
1442
1442
  authParams = {};
1443
1443
  }
1444
1444
 
1445
1445
  if (params) {
1446
- _get(_getPrototypeOf(Account.prototype), "authenticate", this).call(this, authParams, params).then(resonse => {
1447
- if (resonse) {
1448
- window.localStorage.setItem(STORAGE_TOKEN_KEY, resonse.token);
1449
- window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, resonse.refreshToken);
1450
- }
1451
- });
1446
+ const response = await _get(_getPrototypeOf(Account.prototype), "authenticate", this).call(this, authParams, params);
1447
+
1448
+ if (response) {
1449
+ window.localStorage.setItem(STORAGE_TOKEN_KEY, response.token);
1450
+ window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, response.refreshToken);
1451
+ }
1452
1452
  }
1453
1453
  }
1454
1454
  }, {
@@ -7614,7 +7614,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
7614
7614
  } = _ref2;
7615
7615
 
7616
7616
  try {
7617
- this.account.login(authParams, authQueryParams);
7617
+ await this.account.login(authParams, authQueryParams);
7618
7618
 
7619
7619
  if (fetchUser) {
7620
7620
  await this.account.fetchCurrentUser();