web-mojo 2.1.811 → 2.1.824
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/dist/admin.cjs.js +1 -1
- package/dist/admin.cjs.js.map +1 -1
- package/dist/admin.es.js +68 -21
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.cjs.js.map +1 -1
- package/dist/auth.es.js +32 -15
- package/dist/auth.es.js.map +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +2 -2
- package/dist/chunks/{ChatView-ClzTkaOU.js → ChatView-Dm-1ojKc.js} +2 -2
- package/dist/chunks/ChatView-Dm-1ojKc.js.map +1 -0
- package/dist/chunks/{ChatView-BOWKLcbM.js → ChatView-DsdSe1A5.js} +8 -10
- package/dist/chunks/ChatView-DsdSe1A5.js.map +1 -0
- package/dist/chunks/{ContextMenu-CW5SJtd0.js → ContextMenu-6zcMDDiv.js} +2 -2
- package/dist/chunks/{ContextMenu-CW5SJtd0.js.map → ContextMenu-6zcMDDiv.js.map} +1 -1
- package/dist/chunks/{ContextMenu-D7798ql5.js → ContextMenu-C7wfFMyp.js} +2 -2
- package/dist/chunks/{ContextMenu-D7798ql5.js.map → ContextMenu-C7wfFMyp.js.map} +1 -1
- package/dist/chunks/{DataView-BO_3CKit.js → DataView-BDxfTYf0.js} +2 -2
- package/dist/chunks/{DataView-BO_3CKit.js.map → DataView-BDxfTYf0.js.map} +1 -1
- package/dist/chunks/{DataView-BXc0ng8n.js → DataView-BJCAbOpx.js} +2 -2
- package/dist/chunks/{DataView-BXc0ng8n.js.map → DataView-BJCAbOpx.js.map} +1 -1
- package/dist/chunks/{Dialog-S8KdrNk8.js → Dialog-B8_iNgDO.js} +2 -2
- package/dist/chunks/{Dialog-S8KdrNk8.js.map → Dialog-B8_iNgDO.js.map} +1 -1
- package/dist/chunks/{Dialog-DPM6giEy.js → Dialog-CCnOsBBK.js} +5 -5
- package/dist/chunks/{Dialog-DPM6giEy.js.map → Dialog-CCnOsBBK.js.map} +1 -1
- package/dist/chunks/{FormView-kO6LzlPt.js → FormView-CHyzkf7A.js} +26 -2
- package/dist/chunks/{FormView-kO6LzlPt.js.map → FormView-CHyzkf7A.js.map} +1 -1
- package/dist/chunks/{FormView-Dnv2RKTt.js → FormView-NYVaTwDE.js} +3 -3
- package/dist/chunks/{FormView-Dnv2RKTt.js.map → FormView-NYVaTwDE.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-D4rAxlWS.js → MetricsMiniChartWidget-Co_cyqd4.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-D4rAxlWS.js.map → MetricsMiniChartWidget-Co_cyqd4.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-aVmfCf4Q.js → MetricsMiniChartWidget-DkroX-HM.js} +3 -3
- package/dist/chunks/{MetricsMiniChartWidget-aVmfCf4Q.js.map → MetricsMiniChartWidget-DkroX-HM.js.map} +1 -1
- package/dist/chunks/{PDFViewer-Po0eI8C8.js → PDFViewer-CFbFrBdS.js} +2 -2
- package/dist/chunks/{PDFViewer-Po0eI8C8.js.map → PDFViewer-CFbFrBdS.js.map} +1 -1
- package/dist/chunks/{PDFViewer-BQiFwPVS.js → PDFViewer-DLYyetM9.js} +3 -3
- package/dist/chunks/{PDFViewer-BQiFwPVS.js.map → PDFViewer-DLYyetM9.js.map} +1 -1
- package/dist/chunks/{Page-JZMEpEA3.js → Page-C1nY4u_3.js} +2 -2
- package/dist/chunks/{Page-JZMEpEA3.js.map → Page-C1nY4u_3.js.map} +1 -1
- package/dist/chunks/{Page-BVQ0kGQe.js → Page-kuadj0PG.js} +2 -2
- package/dist/chunks/{Page-BVQ0kGQe.js.map → Page-kuadj0PG.js.map} +1 -1
- package/dist/chunks/{TopNav-CEUCxmaH.js → TopNav-B40XDQjS.js} +2 -2
- package/dist/chunks/{TopNav-CEUCxmaH.js.map → TopNav-B40XDQjS.js.map} +1 -1
- package/dist/chunks/{TopNav-CXEa9ca5.js → TopNav-CkJNTimo.js} +5 -5
- package/dist/chunks/{TopNav-CXEa9ca5.js.map → TopNav-CkJNTimo.js.map} +1 -1
- package/dist/chunks/{WebApp-DjJ8JIKq.js → WebApp-D0vBp8ks.js} +2 -2
- package/dist/chunks/{WebApp-DjJ8JIKq.js.map → WebApp-D0vBp8ks.js.map} +1 -1
- package/dist/chunks/{WebApp-BLvli-X8.js → WebApp-DT6XLijH.js} +13 -13
- package/dist/chunks/{WebApp-BLvli-X8.js.map → WebApp-DT6XLijH.js.map} +1 -1
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +11 -11
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/ChatView-BOWKLcbM.js.map +0 -1
- package/dist/chunks/ChatView-ClzTkaOU.js.map +0 -1
package/dist/auth.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as VERSION, W as WebApp } from "./chunks/WebApp-
|
|
2
|
-
import { B, a, c, e, f } from "./chunks/WebApp-
|
|
1
|
+
import { b as VERSION, W as WebApp } from "./chunks/WebApp-DT6XLijH.js";
|
|
2
|
+
import { B, a, c, e, f } from "./chunks/WebApp-DT6XLijH.js";
|
|
3
3
|
import { T as TokenManager } from "./chunks/TokenManager-CAZNcCMs.js";
|
|
4
|
-
import { P as Page } from "./chunks/Page-
|
|
4
|
+
import { P as Page } from "./chunks/Page-kuadj0PG.js";
|
|
5
5
|
class AuthManager {
|
|
6
6
|
constructor(app, config = {}) {
|
|
7
7
|
this.app = app;
|
|
@@ -230,7 +230,7 @@ class AuthManager {
|
|
|
230
230
|
* Reset password with a token from an email link
|
|
231
231
|
* @param {string} token - Reset token
|
|
232
232
|
* @param {string} newPassword - New password
|
|
233
|
-
* @returns {Promise<object>} Reset result
|
|
233
|
+
* @returns {Promise<object>} Reset result with tokens
|
|
234
234
|
*/
|
|
235
235
|
async resetPasswordWithToken(token, newPassword) {
|
|
236
236
|
const payload = {
|
|
@@ -239,8 +239,15 @@ class AuthManager {
|
|
|
239
239
|
};
|
|
240
240
|
const response = await this.app.rest.POST("/api/auth/password/reset/token", payload);
|
|
241
241
|
if (response.success && response.data.status) {
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
const { access_token, refresh_token, user } = response.data.data;
|
|
243
|
+
this.tokenManager.setTokens(access_token, refresh_token, true);
|
|
244
|
+
const userInfo = this.tokenManager.getUserInfo();
|
|
245
|
+
this.setAuthState({ ...user, ...userInfo });
|
|
246
|
+
if (this.config.autoRefresh) {
|
|
247
|
+
this.scheduleTokenRefresh();
|
|
248
|
+
}
|
|
249
|
+
this.emit("resetPasswordSuccess", this.user);
|
|
250
|
+
return { success: true, user: this.user };
|
|
244
251
|
}
|
|
245
252
|
const message = response.data?.error || response.message || "Failed to reset password.";
|
|
246
253
|
this.emit("resetPasswordError", { message });
|
|
@@ -251,7 +258,7 @@ class AuthManager {
|
|
|
251
258
|
* @param {string} email - User's email
|
|
252
259
|
* @param {string} code - The verification code
|
|
253
260
|
* @param {string} newPassword - New password
|
|
254
|
-
* @returns {Promise<object>} Reset result
|
|
261
|
+
* @returns {Promise<object>} Reset result with tokens
|
|
255
262
|
*/
|
|
256
263
|
async resetPasswordWithCode(email, code, newPassword) {
|
|
257
264
|
const payload = {
|
|
@@ -261,8 +268,15 @@ class AuthManager {
|
|
|
261
268
|
};
|
|
262
269
|
const response = await this.app.rest.POST("/api/auth/password/reset/code", payload);
|
|
263
270
|
if (response.success && response.data.status) {
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
const { access_token, refresh_token, user } = response.data.data;
|
|
272
|
+
this.tokenManager.setTokens(access_token, refresh_token, true);
|
|
273
|
+
const userInfo = this.tokenManager.getUserInfo();
|
|
274
|
+
this.setAuthState({ ...user, ...userInfo });
|
|
275
|
+
if (this.config.autoRefresh) {
|
|
276
|
+
this.scheduleTokenRefresh();
|
|
277
|
+
}
|
|
278
|
+
this.emit("resetPasswordSuccess", this.user);
|
|
279
|
+
return { success: true, user: this.user };
|
|
266
280
|
}
|
|
267
281
|
const message = response.data?.error || response.message || "Failed to reset password.";
|
|
268
282
|
this.emit("resetPasswordError", { message });
|
|
@@ -797,7 +811,10 @@ class ForgotPasswordPage extends Page {
|
|
|
797
811
|
const response = await auth.resetPasswordWithCode(this.data.email, code, new_password);
|
|
798
812
|
if (response.success) {
|
|
799
813
|
await this.updateData({ step: "success", isLoading: false }, true);
|
|
800
|
-
setTimeout(() =>
|
|
814
|
+
setTimeout(() => {
|
|
815
|
+
this.getApp().showSuccess("Password reset complete. Welcome back!");
|
|
816
|
+
this.getApp().navigate("/");
|
|
817
|
+
}, 2e3);
|
|
801
818
|
} else {
|
|
802
819
|
await this.updateData({ error: response.message, isLoading: false }, true);
|
|
803
820
|
}
|
|
@@ -874,7 +891,7 @@ class ResetPasswordPage extends Page {
|
|
|
874
891
|
await super.onEnter();
|
|
875
892
|
document.title = `${ResetPasswordPage.title} - ${this.authConfig.ui.title}`;
|
|
876
893
|
const urlParams = new URLSearchParams(window.location.search);
|
|
877
|
-
this.resetToken = urlParams.get("token") || "";
|
|
894
|
+
this.resetToken = urlParams.get("token") || urlParams.get("login_token") || "";
|
|
878
895
|
if (!this.resetToken) {
|
|
879
896
|
this.updateData({
|
|
880
897
|
error: "Invalid or missing reset token. Please request a new password reset.",
|
|
@@ -990,13 +1007,13 @@ class ResetPasswordPage extends Page {
|
|
|
990
1007
|
if (response.success) {
|
|
991
1008
|
await this.updateData({
|
|
992
1009
|
success: true,
|
|
993
|
-
successMessage:
|
|
1010
|
+
successMessage: "Password reset successful! Logging you in...",
|
|
994
1011
|
isLoading: false
|
|
995
1012
|
}, true);
|
|
996
1013
|
setTimeout(() => {
|
|
997
|
-
this.getApp().showSuccess("Password reset complete.
|
|
998
|
-
this.getApp().navigate("/
|
|
999
|
-
},
|
|
1014
|
+
this.getApp().showSuccess("Password reset complete. Welcome back!");
|
|
1015
|
+
this.getApp().navigate("/");
|
|
1016
|
+
}, 2e3);
|
|
1000
1017
|
} else {
|
|
1001
1018
|
await this.updateData({
|
|
1002
1019
|
error: response.message || "Password reset failed. Please try again.",
|