@etsoo/materialui 1.4.14 → 1.4.15
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/lib/app/ReactApp.js +5 -4
- package/package.json +2 -2
- package/src/app/ReactApp.ts +7 -6
package/lib/app/ReactApp.js
CHANGED
|
@@ -203,15 +203,16 @@ export class ReactApp extends CoreApp {
|
|
|
203
203
|
* @returns Result
|
|
204
204
|
*/
|
|
205
205
|
async tryLogin(data) {
|
|
206
|
+
// Destruct
|
|
207
|
+
const { onFailure = () => {
|
|
208
|
+
this.toLoginPage(rest);
|
|
209
|
+
}, onSuccess, ...rest } = data ?? {};
|
|
206
210
|
// Check status
|
|
207
211
|
const result = await super.tryLogin(data);
|
|
208
212
|
if (!result) {
|
|
213
|
+
onFailure();
|
|
209
214
|
return false;
|
|
210
215
|
}
|
|
211
|
-
// Destruct
|
|
212
|
-
const { onFailure = () => {
|
|
213
|
-
this.toLoginPage(rest);
|
|
214
|
-
}, onSuccess, ...rest } = data ?? {};
|
|
215
216
|
// Refresh token
|
|
216
217
|
await this.refreshToken({
|
|
217
218
|
showLoading: data?.showLoading
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.15",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
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.
|
|
53
|
+
"@etsoo/appscript": "^1.5.56",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.52",
|
|
55
55
|
"@etsoo/react": "^1.7.89",
|
|
56
56
|
"@etsoo/shared": "^1.2.51",
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -425,12 +425,6 @@ export class ReactApp<
|
|
|
425
425
|
* @returns Result
|
|
426
426
|
*/
|
|
427
427
|
override async tryLogin(data?: AppTryLoginParams) {
|
|
428
|
-
// Check status
|
|
429
|
-
const result = await super.tryLogin(data);
|
|
430
|
-
if (!result) {
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
428
|
// Destruct
|
|
435
429
|
const {
|
|
436
430
|
onFailure = () => {
|
|
@@ -440,6 +434,13 @@ export class ReactApp<
|
|
|
440
434
|
...rest
|
|
441
435
|
} = data ?? {};
|
|
442
436
|
|
|
437
|
+
// Check status
|
|
438
|
+
const result = await super.tryLogin(data);
|
|
439
|
+
if (!result) {
|
|
440
|
+
onFailure();
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
|
|
443
444
|
// Refresh token
|
|
444
445
|
await this.refreshToken(
|
|
445
446
|
{
|