@fishawack/lab-velocity 2.0.0-beta.50 → 2.0.0-beta.52
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.
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clears all client-accessible cookies on both the current hostname
|
|
3
|
+
* and the apex domain, with path=/ to match cookies set with a path.
|
|
4
|
+
*
|
|
5
|
+
* e.g. for 360.avalerehealth.com this clears cookies on:
|
|
6
|
+
* - 360.avalerehealth.com
|
|
7
|
+
* - .360.avalerehealth.com
|
|
8
|
+
* - .avalerehealth.com
|
|
9
|
+
* - (no domain — browser default)
|
|
10
|
+
*/
|
|
11
|
+
export default function clearCookies() {
|
|
12
|
+
const hostname = location.hostname;
|
|
13
|
+
const parts = hostname.split(".");
|
|
14
|
+
const domains = [hostname];
|
|
15
|
+
|
|
16
|
+
// Build domain variants: .360.avalerehealth.com, .avalerehealth.com
|
|
17
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
18
|
+
domains.push("." + parts.slice(i).join("."));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
document.cookie.split(";").forEach((cookie) => {
|
|
22
|
+
const name = cookie.split("=")[0].trim();
|
|
23
|
+
if (!name) return;
|
|
24
|
+
|
|
25
|
+
// Clear with no domain (browser default)
|
|
26
|
+
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
|
|
27
|
+
|
|
28
|
+
// Clear on each domain variant
|
|
29
|
+
domains.forEach((domain) => {
|
|
30
|
+
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${domain}`;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import axios from "axios";
|
|
3
|
-
import
|
|
3
|
+
import clearCookies from "../js/clear-cookies";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
metaInfo() {
|
|
@@ -16,10 +16,7 @@ export default {
|
|
|
16
16
|
/* empty */
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
Object.keys(Cookies.get()).forEach(function (cookie, attributes) {
|
|
21
|
-
Cookies.remove(cookie, attributes);
|
|
22
|
-
});
|
|
19
|
+
clearCookies();
|
|
23
20
|
|
|
24
21
|
try {
|
|
25
22
|
await axios.get("/sanctum/csrf-cookie");
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
+
import axios from "axios";
|
|
7
|
+
import clearCookies from "../js/clear-cookies";
|
|
8
|
+
|
|
6
9
|
export default {
|
|
7
10
|
metaInfo() {
|
|
8
11
|
return {
|
|
@@ -17,9 +20,19 @@ export default {
|
|
|
17
20
|
async mounted() {
|
|
18
21
|
try {
|
|
19
22
|
await this.$store.dispatch("logout");
|
|
20
|
-
}
|
|
21
|
-
|
|
23
|
+
} catch {
|
|
24
|
+
/* empty */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
clearCookies();
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
await axios.get("/sanctum/csrf-cookie");
|
|
31
|
+
} catch {
|
|
32
|
+
/* empty */
|
|
22
33
|
}
|
|
34
|
+
|
|
35
|
+
this.done = true;
|
|
23
36
|
},
|
|
24
37
|
};
|
|
25
38
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishawack/lab-velocity",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.52",
|
|
4
4
|
"description": "Avalere Health branded style system",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup": "npm ci || npm i && npm run content",
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"dayjs": "^1.11.20",
|
|
58
58
|
"element-plus": "^2.11.8",
|
|
59
59
|
"form-backend-validation": "github:mikemellor11/form-backend-validation#master",
|
|
60
|
-
"js-cookie": "^3.0.5",
|
|
61
60
|
"lodash": "^4.17.21",
|
|
62
61
|
"quill": "^1.3.7",
|
|
63
62
|
"sanitize-html": "^2.13.1"
|