@fishawack/lab-velocity 2.0.0-beta.53 → 2.0.0-beta.54
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/_Build/vue/modules/AuthModule/js/clear-cookies.js +13 -12
- package/_Build/vue/modules/AuthModule/routes/login.vue +1 -1
- package/_Build/vue/modules/AuthModule/routes/loginsso.vue +1 -1
- package/_Build/vue/modules/AuthModule/routes/logout.vue +1 -1
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* Clears all
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* - 360.avalerehealth.com
|
|
7
|
-
* - .360.avalerehealth.com
|
|
8
|
-
* - .avalerehealth.com
|
|
9
|
-
* - (no domain — browser default)
|
|
4
|
+
* Clears all cookies by:
|
|
5
|
+
* 1. Calling the server endpoint to expire HttpOnly cookies (remember token, session)
|
|
6
|
+
* across all parent domain variants
|
|
7
|
+
* 2. Clearing all client-accessible cookies via document.cookie as a fallback
|
|
10
8
|
*/
|
|
11
|
-
export default function clearCookies() {
|
|
9
|
+
export default async function clearCookies() {
|
|
10
|
+
try {
|
|
11
|
+
await axios.post("/hydrate/clear-cookies");
|
|
12
|
+
} catch {
|
|
13
|
+
/* endpoint may not exist on older backends */
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
const hostname = location.hostname;
|
|
13
17
|
const parts = hostname.split(".");
|
|
14
18
|
const domains = [hostname];
|
|
15
19
|
|
|
16
|
-
// Build domain variants: .360.avalerehealth.com, .avalerehealth.com
|
|
17
20
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
18
21
|
domains.push("." + parts.slice(i).join("."));
|
|
19
22
|
}
|
|
@@ -22,10 +25,8 @@ export default function clearCookies() {
|
|
|
22
25
|
const name = cookie.split("=")[0].trim();
|
|
23
26
|
if (!name) return;
|
|
24
27
|
|
|
25
|
-
// Clear with no domain (browser default)
|
|
26
28
|
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
|
|
27
29
|
|
|
28
|
-
// Clear on each domain variant
|
|
29
30
|
domains.forEach((domain) => {
|
|
30
31
|
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${domain}`;
|
|
31
32
|
});
|
|
@@ -79,7 +79,7 @@ export default {
|
|
|
79
79
|
email: this.$route.query.email ?? "",
|
|
80
80
|
password: "",
|
|
81
81
|
device_name: "Mobile device",
|
|
82
|
-
remember:
|
|
82
|
+
remember: true,
|
|
83
83
|
},
|
|
84
84
|
{ resetOnSuccess: false },
|
|
85
85
|
),
|