@fishawack/lab-velocity 2.0.0-beta.49 → 2.0.0-beta.50

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.
@@ -29,20 +29,8 @@ function setAxiosDefaults(baseUrl, router) {
29
29
  axios.interceptors.response.use(null, (error) => {
30
30
  if (error.response) {
31
31
  if (
32
- error.response.status === 419 ||
33
- error.response.status === 401
34
- ) {
35
- // Clear XSRF-TOKEN across all domain levels to prevent duplicate cookie issues
36
- const hostname = location.hostname.split(".");
37
- for (let i = 0; i < hostname.length; i++) {
38
- const domain = hostname.slice(i).join(".");
39
- document.cookie = `XSRF-TOKEN=;max-age=0;path=/;domain=.${domain}`;
40
- }
41
- document.cookie = "XSRF-TOKEN=;max-age=0;path=/";
42
- }
43
-
44
- if (
45
- error.response.status === 401 &&
32
+ (error.response.status === 401 ||
33
+ error.response.status === 419) &&
46
34
  router.currentRoute.value.name !== "auth.logout"
47
35
  ) {
48
36
  router.push({
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import axios from "axios";
3
+ import Cookies from "js-cookie";
3
4
 
4
5
  export default {
5
6
  metaInfo() {
@@ -15,6 +16,11 @@ export default {
15
16
  /* empty */
16
17
  }
17
18
 
19
+ // Clear all cookies
20
+ Object.keys(Cookies.get()).forEach(function (cookie, attributes) {
21
+ Cookies.remove(cookie, attributes);
22
+ });
23
+
18
24
  try {
19
25
  await axios.get("/sanctum/csrf-cookie");
20
26
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-velocity",
3
- "version": "2.0.0-beta.49",
3
+ "version": "2.0.0-beta.50",
4
4
  "description": "Avalere Health branded style system",
5
5
  "scripts": {
6
6
  "setup": "npm ci || npm i && npm run content",
@@ -57,6 +57,7 @@
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",
60
61
  "lodash": "^4.17.21",
61
62
  "quill": "^1.3.7",
62
63
  "sanitize-html": "^2.13.1"