@etsoo/react 1.3.65 → 1.3.66

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.
@@ -115,7 +115,11 @@ export class ServiceApp extends ReactApp {
115
115
  failCallback(this.get('noData'));
116
116
  return false;
117
117
  }
118
+ // Login
118
119
  this.userLoginEx(serviceResult.data, refreshToken, userData);
120
+ // Success callback
121
+ if (failCallback)
122
+ failCallback(true);
119
123
  return true;
120
124
  };
121
125
  // Call API
@@ -133,13 +137,18 @@ export class ServiceApp extends ReactApp {
133
137
  return;
134
138
  }
135
139
  // Set password for the action
136
- rq.pwd = this.encrypt(pwd, this.settings.serviceId.toString());
140
+ rq.pwd = this.encrypt(this.hash(pwd));
137
141
  // Submit again
138
- const result = await this.api.put('Auth/RefreshToken', data, payload);
142
+ const result = await this.api.put('Auth/RefreshToken', rq, payload);
139
143
  if (result == null)
140
144
  return;
141
145
  if (result.ok) {
142
146
  await success(result, (loginResult) => {
147
+ if (loginResult === true) {
148
+ if (callback)
149
+ callback(true);
150
+ return;
151
+ }
143
152
  const message = this.formatRefreshTokenResult(loginResult);
144
153
  if (message)
145
154
  this.notifier.alert(message);
@@ -174,6 +183,9 @@ export class ServiceApp extends ReactApp {
174
183
  // Refresh token
175
184
  return await this.refreshToken({
176
185
  callback: (result) => {
186
+ // Success
187
+ if (result === true)
188
+ return;
177
189
  const message = this.formatRefreshTokenResult(result);
178
190
  if (message == null) {
179
191
  this.loginFailed();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.3.65",
3
+ "version": "1.3.66",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "@emotion/react": "^11.7.1",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.1.82",
53
+ "@etsoo/appscript": "^1.1.83",
54
54
  "@etsoo/notificationbase": "^1.0.94",
55
55
  "@etsoo/shared": "^1.0.78",
56
56
  "@mui/icons-material": "^5.2.4",
@@ -168,8 +168,12 @@ export class ServiceApp<
168
168
  return false;
169
169
  }
170
170
 
171
+ // Login
171
172
  this.userLoginEx(serviceResult.data, refreshToken, userData);
172
173
 
174
+ // Success callback
175
+ if (failCallback) failCallback(true);
176
+
173
177
  return true;
174
178
  };
175
179
 
@@ -195,15 +199,12 @@ export class ServiceApp<
195
199
  }
196
200
 
197
201
  // Set password for the action
198
- rq.pwd = this.encrypt(
199
- pwd,
200
- this.settings.serviceId.toString()
201
- );
202
+ rq.pwd = this.encrypt(this.hash(pwd));
202
203
 
203
204
  // Submit again
204
205
  const result = await this.api.put<SmartERPLoginResult>(
205
206
  'Auth/RefreshToken',
206
- data,
207
+ rq,
207
208
  payload
208
209
  );
209
210
 
@@ -213,6 +214,11 @@ export class ServiceApp<
213
214
  await success(
214
215
  result,
215
216
  (loginResult: RefreshTokenResult) => {
217
+ if (loginResult === true) {
218
+ if (callback) callback(true);
219
+ return;
220
+ }
221
+
216
222
  const message =
217
223
  this.formatRefreshTokenResult(
218
224
  loginResult
@@ -258,6 +264,9 @@ export class ServiceApp<
258
264
  // Refresh token
259
265
  return await this.refreshToken({
260
266
  callback: (result) => {
267
+ // Success
268
+ if (result === true) return;
269
+
261
270
  const message = this.formatRefreshTokenResult(result);
262
271
  if (message == null) {
263
272
  this.loginFailed();