From f6bd99d718fc3c641f1f613ffaf7b4bfda016e1e Mon Sep 17 00:00:00 2001
From: Anas El Alami <anaselalamikh@gmail.com>
Date: Thu, 22 Oct 2020 17:45:19 +0200
Subject: [PATCH] Adding { SameSite: 'Lax' } to Cookies.set attributes

---
 src/store/modules/app.js | 8 ++++----
 src/utils/auth.js        | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index 45d89bb9..c61b712a 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -14,13 +14,13 @@ const mutations = {
     state.sidebar.opened = !state.sidebar.opened
     state.sidebar.withoutAnimation = false
     if (state.sidebar.opened) {
-      Cookies.set('sidebarStatus', 1)
+      Cookies.set('sidebarStatus', 1, { SameSite: 'Lax' })
     } else {
-      Cookies.set('sidebarStatus', 0)
+      Cookies.set('sidebarStatus', 0, { SameSite: 'Lax' })
     }
   },
   CLOSE_SIDEBAR: (state, withoutAnimation) => {
-    Cookies.set('sidebarStatus', 0)
+    Cookies.set('sidebarStatus', 0, { SameSite: 'Lax' })
     state.sidebar.opened = false
     state.sidebar.withoutAnimation = withoutAnimation
   },
@@ -29,7 +29,7 @@ const mutations = {
   },
   SET_SIZE: (state, size) => {
     state.size = size
-    Cookies.set('size', size)
+    Cookies.set('size', size, { SameSite: 'Lax' })
   }
 }
 
diff --git a/src/utils/auth.js b/src/utils/auth.js
index 08a43d6e..5950e116 100644
--- a/src/utils/auth.js
+++ b/src/utils/auth.js
@@ -7,7 +7,7 @@ export function getToken() {
 }
 
 export function setToken(token) {
-  return Cookies.set(TokenKey, token)
+  return Cookies.set(TokenKey, token, { SameSite: 'Lax' })
 }
 
 export function removeToken() {