@steroidsjs/core 2.2.92 → 2.2.94

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.
@@ -103,7 +103,7 @@ var HttpComponent = /** @class */ (function () {
103
103
  }
104
104
  if (!(this._accessToken === false)) return [3 /*break*/, 4];
105
105
  clientStorage = this._components.clientStorage;
106
- tokenValue = clientStorage.get(this.accessTokenKey, clientStorage.STORAGE_COOKIE)
106
+ tokenValue = clientStorage.get(this.accessTokenKey, this.clientStorageName)
107
107
  || clientStorage.get(this.accessTokenKey)
108
108
  || null;
109
109
  // client storage method 'get' could be asynchronous
@@ -120,7 +120,7 @@ var HttpComponent = /** @class */ (function () {
120
120
  // client storage method 'get' could be asynchronous
121
121
  _a._accessToken = _b;
122
122
  if (this._accessToken) {
123
- clientStorage.set(this.accessTokenKey, this._accessToken, clientStorage.STORAGE_COOKIE, 180);
123
+ clientStorage.set(this.accessTokenKey, this._accessToken, this.clientStorageName, this.clientStorageExpiresIn);
124
124
  }
125
125
  _c.label = 4;
126
126
  case 4:
@@ -76,7 +76,7 @@ var JwtHttpComponent = /** @class */ (function (_super) {
76
76
  config = _super.prototype.getAxiosConfig.call(this);
77
77
  if (!!this._refreshToken) return [3 /*break*/, 4];
78
78
  clientStorage = this._components.clientStorage;
79
- tokenValue = clientStorage.get(this.refreshTokenKey, clientStorage.STORAGE_COOKIE)
79
+ tokenValue = clientStorage.get(this.refreshTokenKey, this.clientStorageName)
80
80
  || clientStorage.get(this.refreshTokenKey)
81
81
  || null;
82
82
  _a = this;
@@ -91,7 +91,7 @@ var JwtHttpComponent = /** @class */ (function (_super) {
91
91
  case 3:
92
92
  _a._refreshToken = _b;
93
93
  if (this._refreshToken) {
94
- clientStorage.set(this.refreshTokenKey, this._refreshToken, clientStorage.STORAGE_COOKIE, 180);
94
+ clientStorage.set(this.refreshTokenKey, this._refreshToken, this.clientStorageName, this.clientStorageExpiresIn);
95
95
  }
96
96
  _c.label = 4;
97
97
  case 4: return [2 /*return*/, config];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.92",
3
+ "version": "2.2.94",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -64,6 +64,11 @@ export interface IFormProps {
64
64
  * @param args
65
65
  */
66
66
  onChange?: (...args: any[]) => any;
67
+ /**
68
+ * Обработчик события ошибки выполнения запроса
69
+ * @param args
70
+ */
71
+ onError?: (...args: any[]) => any;
67
72
  /**
68
73
  * Обработчик успешного выполнения формы (без ошибок)
69
74
  * @param args
@@ -271,6 +271,7 @@ function Form(props) {
271
271
  requestError_1 = _c.sent();
272
272
  console.error(requestError_1); // eslint-disable-line no-console
273
273
  dispatch(form_2.formSetSubmitting(props.formId, false));
274
+ props.onError(requestError_1);
274
275
  reduxDispatch(notifications_1.showNotification(props.submitErrorMessage || __('Ошибка сервера'), 'danger'));
275
276
  return [2 /*return*/, null];
276
277
  case 12: