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

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.
@@ -28,6 +28,19 @@ function setAxiosDefaults(baseUrl, router) {
28
28
  // Redirect to login page if 401
29
29
  axios.interceptors.response.use(null, (error) => {
30
30
  if (error.response) {
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
+
31
44
  if (
32
45
  error.response.status === 401 &&
33
46
  router.currentRoute.value.name !== "auth.logout"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-velocity",
3
- "version": "2.0.0-beta.48",
3
+ "version": "2.0.0-beta.49",
4
4
  "description": "Avalere Health branded style system",
5
5
  "scripts": {
6
6
  "setup": "npm ci || npm i && npm run content",