@vc-shell/framework 1.0.251 → 1.0.253
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [1.0.253](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.252...v1.0.253) (2024-07-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **shared:** update login logic to redirect to the previous page after successful login ([8701044](https://github.com/VirtoCommerce/vc-shell/commit/8701044315a7b13609474e00e83a069d542bb256))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [1.0.252](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.251...v1.0.252) (2024-07-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
1
14
|
## [1.0.251](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.250...v1.0.251) (2024-07-08)
|
|
2
15
|
|
|
3
16
|
|
package/dist/framework.js
CHANGED
|
@@ -61601,7 +61601,12 @@ const zLe = (t) => function() {
|
|
|
61601
61601
|
}), D = Bn({
|
|
61602
61602
|
loginOrEmail: ""
|
|
61603
61603
|
}), S = async () => {
|
|
61604
|
-
|
|
61604
|
+
if (g.value)
|
|
61605
|
+
if (l.value.error = "", l.value = await d(O.username, O.password), l.value.succeeded) {
|
|
61606
|
+
const I = localStorage.getItem("redirectAfterLogin") || "/";
|
|
61607
|
+
localStorage.removeItem("redirectAfterLogin"), await n.push(I);
|
|
61608
|
+
} else
|
|
61609
|
+
l.value.status ? l.value.status === 401 ? (l.value.error = "The login or password is incorrect.", O.password = "", r("password")) : l.value.error = "Authentication error (code: " + l.value.status + ")." : l.value.error = "Authentication error: " + l.value.error;
|
|
61605
61610
|
}, A = async () => {
|
|
61606
61611
|
if (g.value && b)
|
|
61607
61612
|
try {
|
|
@@ -76080,15 +76085,16 @@ const R9 = {
|
|
|
76080
76085
|
let a = {};
|
|
76081
76086
|
return Object.keys(i.params).length > 0 && (a = Object.fromEntries(Object.entries(i.params).filter(([o]) => o !== "pathMatch"))), a;
|
|
76082
76087
|
};
|
|
76083
|
-
e.router.beforeEach(async (i) => {
|
|
76084
|
-
const { isAuthenticated:
|
|
76088
|
+
e.router.beforeEach(async (i, a, o) => {
|
|
76089
|
+
const { isAuthenticated: s } = so();
|
|
76085
76090
|
if (i.name !== "Login" && i.name !== "ResetPassword" && i.name !== "Invite")
|
|
76086
76091
|
try {
|
|
76087
|
-
|
|
76092
|
+
s.value ? o() : (localStorage.setItem("redirectAfterLogin", i.fullPath), o({ name: "Login" }));
|
|
76088
76093
|
} catch {
|
|
76089
|
-
|
|
76094
|
+
localStorage.setItem("redirectAfterLogin", i.fullPath), o({ name: "Login" });
|
|
76090
76095
|
}
|
|
76091
|
-
else
|
|
76096
|
+
else
|
|
76097
|
+
o();
|
|
76092
76098
|
}), e.router.beforeEach((i, a) => {
|
|
76093
76099
|
const { hasAccess: o } = pp();
|
|
76094
76100
|
if (i.meta.permissions) {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAa,MAAM,KAAK,CAAC;AAIrC,OAAO,EAAE,IAAI,EAAe,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAU5D,OAAO,eAAe,CAAC;AACvB,OAAO,4BAA4B,CAAC;;iBAK3B,GAAG,QACF;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE;YACL,MAAM,EAAE,MAAM,CAAC;YACf,cAAc,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,OAAO,CAAC,EAAE,MAAM,CAAC;SA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"version":3,"file":"Login.vue.d.ts","sourceRoot":"","sources":["../../../../../../shared/pages/LoginPage/components/login/Login.vue.ts"],"names":[],"mappings":"AAaA,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5E,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM;QAAE,cAAc,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAC3D;;
|
|
1
|
+
{"version":3,"file":"Login.vue.d.ts","sourceRoot":"","sources":["../../../../../../shared/pages/LoginPage/components/login/Login.vue.ts"],"names":[],"mappings":"AAaA,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5E,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM;QAAE,cAAc,EAAE,kBAAkB,CAAA;KAAE,CAAC;CAC3D;;AA2jBD,wBAMG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/framework",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.253",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/framework.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/dompurify": "^3.0.5",
|
|
63
63
|
"@types/quill": "^2.0.14",
|
|
64
|
-
"@vc-shell/api-client-generator": "^1.0.
|
|
65
|
-
"@vc-shell/config-generator": "^1.0.
|
|
66
|
-
"@vc-shell/ts-config": "^1.0.
|
|
64
|
+
"@vc-shell/api-client-generator": "^1.0.253",
|
|
65
|
+
"@vc-shell/config-generator": "^1.0.253",
|
|
66
|
+
"@vc-shell/ts-config": "^1.0.253",
|
|
67
67
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
68
68
|
"cypress-signalr-mock": "^1.5.0",
|
|
69
69
|
"sass": "^1.69.6",
|
|
@@ -259,7 +259,9 @@ const login = async () => {
|
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
if (signInResult.value.succeeded) {
|
|
262
|
-
|
|
262
|
+
const redirectTo = localStorage.getItem("redirectAfterLogin") || "/";
|
|
263
|
+
localStorage.removeItem("redirectAfterLogin");
|
|
264
|
+
await router.push(redirectTo);
|
|
263
265
|
} else {
|
|
264
266
|
if (signInResult.value.status) {
|
|
265
267
|
if (signInResult.value.status === 401) {
|