@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.
package/dist/api.esm.js CHANGED
@@ -1433,18 +1433,18 @@ let Account = /*#__PURE__*/function (_AccountService) {
1433
1433
 
1434
1434
  _createClass(Account, [{
1435
1435
  key: "login",
1436
- value: function login(params, authParams) {
1436
+ value: async function login(params, authParams) {
1437
1437
  if (authParams === void 0) {
1438
1438
  authParams = {};
1439
1439
  }
1440
1440
 
1441
1441
  if (params) {
1442
- _get(_getPrototypeOf(Account.prototype), "authenticate", this).call(this, authParams, params).then(resonse => {
1443
- if (resonse) {
1444
- window.localStorage.setItem(STORAGE_TOKEN_KEY, resonse.token);
1445
- window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, resonse.refreshToken);
1446
- }
1447
- });
1442
+ const response = await _get(_getPrototypeOf(Account.prototype), "authenticate", this).call(this, authParams, params);
1443
+
1444
+ if (response) {
1445
+ window.localStorage.setItem(STORAGE_TOKEN_KEY, response.token);
1446
+ window.localStorage.setItem(STORAGE_REFRESH_TOKEN_KEY, response.refreshToken);
1447
+ }
1448
1448
  }
1449
1449
  }
1450
1450
  }, {
@@ -7619,7 +7619,7 @@ let Api = /*#__PURE__*/function (_EventEmitter) {
7619
7619
  } = _ref2;
7620
7620
 
7621
7621
  try {
7622
- this.account.login(authParams, authQueryParams);
7622
+ await this.account.login(authParams, authQueryParams);
7623
7623
 
7624
7624
  if (fetchUser) {
7625
7625
  await this.account.fetchCurrentUser();