@etsoo/materialui 1.3.92 → 1.3.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.
- package/lib/app/IServiceUser.d.ts +5 -0
- package/lib/app/ServiceApp.js +8 -5
- package/package.json +10 -10
- package/src/app/IServiceUser.ts +6 -0
- package/src/app/ServiceApp.ts +10 -6
package/lib/app/ServiceApp.js
CHANGED
|
@@ -42,8 +42,6 @@ export class ServiceApp extends ReactApp {
|
|
|
42
42
|
toLoginPage(tryLogin, removeUrl) {
|
|
43
43
|
// Cache current URL
|
|
44
44
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
45
|
-
// Make sure apply new device id for new login
|
|
46
|
-
this.clearDeviceId();
|
|
47
45
|
// Get the redirect URL
|
|
48
46
|
this.api
|
|
49
47
|
.get("Auth/GetLogInUrl", {
|
|
@@ -53,7 +51,8 @@ export class ServiceApp extends ReactApp {
|
|
|
53
51
|
.then((url) => {
|
|
54
52
|
if (!url)
|
|
55
53
|
return;
|
|
56
|
-
|
|
54
|
+
// Add try login flag
|
|
55
|
+
url = url.addUrlParam("tryLogin", tryLogin ?? false);
|
|
57
56
|
if (BridgeUtils.host == null) {
|
|
58
57
|
globalThis.location.href = url;
|
|
59
58
|
}
|
|
@@ -61,6 +60,8 @@ export class ServiceApp extends ReactApp {
|
|
|
61
60
|
BridgeUtils.host.loadApp(coreName, url);
|
|
62
61
|
}
|
|
63
62
|
});
|
|
63
|
+
// Make sure apply new device id for new login
|
|
64
|
+
this.clearDeviceId();
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
67
|
* User login extended
|
|
@@ -72,11 +73,13 @@ export class ServiceApp extends ReactApp {
|
|
|
72
73
|
userLogin(user, refreshToken, keep, dispatch) {
|
|
73
74
|
// Super call, set token
|
|
74
75
|
super.userLogin(user, refreshToken, keep, dispatch);
|
|
75
|
-
if (user.passphrase) {
|
|
76
|
+
if (user.deviceId && user.passphrase) {
|
|
76
77
|
// Save the passphrase
|
|
77
78
|
const passphrase = this.decrypt(user.passphrase, `${user.uid}-${this.settings.appId}`);
|
|
78
|
-
if (passphrase)
|
|
79
|
+
if (passphrase) {
|
|
80
|
+
this.deviceId = user.deviceId;
|
|
79
81
|
this.updatePassphrase(passphrase);
|
|
82
|
+
}
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.94",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,12 +50,12 @@
|
|
|
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.
|
|
54
|
-
"@etsoo/notificationbase": "^1.1.
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
56
|
-
"@etsoo/shared": "^1.2.
|
|
57
|
-
"@mui/icons-material": "^6.1.
|
|
58
|
-
"@mui/material": "^6.1.
|
|
53
|
+
"@etsoo/appscript": "^1.5.27",
|
|
54
|
+
"@etsoo/notificationbase": "^1.1.49",
|
|
55
|
+
"@etsoo/react": "^1.7.69",
|
|
56
|
+
"@etsoo/shared": "^1.2.48",
|
|
57
|
+
"@mui/icons-material": "^6.1.3",
|
|
58
|
+
"@mui/material": "^6.1.3",
|
|
59
59
|
"@mui/x-data-grid": "^7.19.0",
|
|
60
60
|
"chart.js": "^4.4.4",
|
|
61
61
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
"@types/react-dom": "^18.3.0",
|
|
88
88
|
"@types/react-input-mask": "^3.0.5",
|
|
89
89
|
"@types/react-window": "^1.8.8",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^8.8.
|
|
91
|
-
"@typescript-eslint/parser": "^8.8.
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
|
91
|
+
"@typescript-eslint/parser": "^8.8.1",
|
|
92
92
|
"jest": "^29.7.0",
|
|
93
93
|
"jest-environment-jsdom": "^29.7.0",
|
|
94
|
-
"typescript": "^5.6.
|
|
94
|
+
"typescript": "^5.6.3"
|
|
95
95
|
}
|
|
96
96
|
}
|
package/src/app/IServiceUser.ts
CHANGED
package/src/app/ServiceApp.ts
CHANGED
|
@@ -69,9 +69,6 @@ export class ServiceApp<
|
|
|
69
69
|
// Cache current URL
|
|
70
70
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
71
71
|
|
|
72
|
-
// Make sure apply new device id for new login
|
|
73
|
-
this.clearDeviceId();
|
|
74
|
-
|
|
75
72
|
// Get the redirect URL
|
|
76
73
|
this.api
|
|
77
74
|
.get<string>("Auth/GetLogInUrl", {
|
|
@@ -81,7 +78,8 @@ export class ServiceApp<
|
|
|
81
78
|
.then((url) => {
|
|
82
79
|
if (!url) return;
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
// Add try login flag
|
|
82
|
+
url = url.addUrlParam("tryLogin", tryLogin ?? false);
|
|
85
83
|
|
|
86
84
|
if (BridgeUtils.host == null) {
|
|
87
85
|
globalThis.location.href = url;
|
|
@@ -89,6 +87,9 @@ export class ServiceApp<
|
|
|
89
87
|
BridgeUtils.host.loadApp(coreName, url);
|
|
90
88
|
}
|
|
91
89
|
});
|
|
90
|
+
|
|
91
|
+
// Make sure apply new device id for new login
|
|
92
|
+
this.clearDeviceId();
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
/**
|
|
@@ -107,13 +108,16 @@ export class ServiceApp<
|
|
|
107
108
|
// Super call, set token
|
|
108
109
|
super.userLogin(user, refreshToken, keep, dispatch);
|
|
109
110
|
|
|
110
|
-
if (user.passphrase) {
|
|
111
|
+
if (user.deviceId && user.passphrase) {
|
|
111
112
|
// Save the passphrase
|
|
112
113
|
const passphrase = this.decrypt(
|
|
113
114
|
user.passphrase,
|
|
114
115
|
`${user.uid}-${this.settings.appId}`
|
|
115
116
|
);
|
|
116
|
-
if (passphrase)
|
|
117
|
+
if (passphrase) {
|
|
118
|
+
this.deviceId = user.deviceId;
|
|
119
|
+
this.updatePassphrase(passphrase);
|
|
120
|
+
}
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
}
|