@bexis2/bexis2-core-ui 0.4.62 → 0.4.63
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/README.md
CHANGED
|
@@ -40,10 +40,14 @@ onMount(async () => {
|
|
|
40
40
|
var token = get(csrfTokenStore);
|
|
41
41
|
console.log("\u{1F680} ~ token:", token);
|
|
42
42
|
if (!token || token.length === 0) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const tokenContainer = document.getElementsByName("__RequestVerificationToken")[0];
|
|
44
|
+
if (tokenContainer) {
|
|
45
|
+
const csrfToken = tokenContainer?.value;
|
|
46
|
+
csrfTokenStore.set(csrfToken);
|
|
47
|
+
} else {
|
|
48
|
+
const data = await getAntiForgeryToken();
|
|
49
|
+
csrfTokenStore.set(data.csrfToken);
|
|
50
|
+
}
|
|
47
51
|
title = await getApplicationName();
|
|
48
52
|
}
|
|
49
53
|
});
|
package/package.json
CHANGED
|
@@ -65,20 +65,23 @@ import type { helpItemType, helpStoreType } from '$models/Models';
|
|
|
65
65
|
|
|
66
66
|
if(!token || token.length===0){
|
|
67
67
|
|
|
68
|
+
// check if csrf token exist as hidden field
|
|
69
|
+
const tokenContainer = document.getElementsByName('__RequestVerificationToken')[0]
|
|
70
|
+
if(tokenContainer)
|
|
71
|
+
{
|
|
72
|
+
const csrfToken = tokenContainer?.value;
|
|
73
|
+
csrfTokenStore.set(csrfToken);
|
|
74
|
+
}
|
|
75
|
+
else
|
|
76
|
+
{
|
|
68
77
|
const data = await getAntiForgeryToken();
|
|
69
78
|
csrfTokenStore.set(data.csrfToken);
|
|
70
|
-
var x = get(csrfTokenStore);
|
|
71
|
-
console.log("🚀 ~ x:", x)
|
|
72
79
|
|
|
73
|
-
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
title = await getApplicationName();
|
|
74
83
|
|
|
75
|
-
// get data from parent
|
|
76
|
-
// const container = document.getElementsByName('__RequestVerificationToken')[0];
|
|
77
|
-
// console.log("🚀 ~ container:", container)
|
|
78
|
-
// let csrfToken = container?.getAttribute('value');
|
|
79
|
-
// if(csrfToken) csrfTokenStore.set(csrfToken);
|
|
80
84
|
|
|
81
|
-
//console.log("🚀 ~ csrfToken:", csrfToken)
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
87
|
|