@etsoo/materialui 1.4.9 → 1.4.10

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.
@@ -54,6 +54,11 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
54
54
  * @param dispatch User state dispatch
55
55
  */
56
56
  userLoginEx(user: U & ServiceUserToken, core?: ApiRefreshTokenDto, dispatch?: boolean): void;
57
+ /**
58
+ * Save core system refresh token
59
+ * @param token New refresh token
60
+ */
61
+ protected saveCoreToken(token: string): void;
57
62
  /**
58
63
  * Try login
59
64
  * @param params Login parameters
@@ -110,9 +110,16 @@ export class ServiceApp extends ReactApp {
110
110
  expiresIn: user.seconds
111
111
  });
112
112
  // Cache the core system refresh token
113
- this.storage.setData(coreTokenKey, core.refreshToken);
113
+ this.saveCoreToken(core.refreshToken);
114
114
  this.exchangeTokenAll(core, coreName);
115
115
  }
116
+ /**
117
+ * Save core system refresh token
118
+ * @param token New refresh token
119
+ */
120
+ saveCoreToken(token) {
121
+ this.storage.setData(coreTokenKey, this.encrypt(token));
122
+ }
116
123
  /**
117
124
  * Try login
118
125
  * @param params Login parameters
@@ -134,7 +141,7 @@ export class ServiceApp extends ReactApp {
134
141
  if (data == null)
135
142
  return;
136
143
  // Cache the core system refresh token
137
- this.storage.setData(coreTokenKey, data.refreshToken);
144
+ this.saveCoreToken(data.refreshToken);
138
145
  this.exchangeTokenAll(data, coreName);
139
146
  onSuccess?.();
140
147
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,10 +50,10 @@
50
50
  "@emotion/css": "^11.13.4",
51
51
  "@emotion/react": "^11.13.3",
52
52
  "@emotion/styled": "^11.13.0",
53
- "@etsoo/appscript": "^1.5.50",
54
- "@etsoo/notificationbase": "^1.1.49",
55
- "@etsoo/react": "^1.7.83",
56
- "@etsoo/shared": "^1.2.48",
53
+ "@etsoo/appscript": "^1.5.52",
54
+ "@etsoo/notificationbase": "^1.1.50",
55
+ "@etsoo/react": "^1.7.85",
56
+ "@etsoo/shared": "^1.2.49",
57
57
  "@mui/icons-material": "^6.1.4",
58
58
  "@mui/material": "^6.1.4",
59
59
  "@mui/x-data-grid": "^7.20.0",
@@ -77,7 +77,7 @@
77
77
  "@babel/preset-react": "^7.25.7",
78
78
  "@babel/preset-typescript": "^7.25.7",
79
79
  "@babel/runtime-corejs3": "^7.25.7",
80
- "@testing-library/jest-dom": "^6.5.0",
80
+ "@testing-library/jest-dom": "^6.6.1",
81
81
  "@testing-library/react": "^16.0.1",
82
82
  "@types/jest": "^29.5.13",
83
83
  "@types/pica": "^9.0.4",
@@ -162,11 +162,19 @@ export class ServiceApp<
162
162
  };
163
163
 
164
164
  // Cache the core system refresh token
165
- this.storage.setData(coreTokenKey, core.refreshToken);
165
+ this.saveCoreToken(core.refreshToken);
166
166
 
167
167
  this.exchangeTokenAll(core, coreName);
168
168
  }
169
169
 
170
+ /**
171
+ * Save core system refresh token
172
+ * @param token New refresh token
173
+ */
174
+ protected saveCoreToken(token: string) {
175
+ this.storage.setData(coreTokenKey, this.encrypt(token));
176
+ }
177
+
170
178
  /**
171
179
  * Try login
172
180
  * @param params Login parameters
@@ -190,7 +198,7 @@ export class ServiceApp<
190
198
  if (data == null) return;
191
199
 
192
200
  // Cache the core system refresh token
193
- this.storage.setData(coreTokenKey, data.refreshToken);
201
+ this.saveCoreToken(data.refreshToken);
194
202
 
195
203
  this.exchangeTokenAll(data, coreName);
196
204