Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

improvement

Blue Mouse292b54f794b9
diff --git a/src/utils/accessToken.js b/src/utils/accessToken.js
index 43a3fe1b6..aa74cb322 100644
--- a/src/utils/accessToken.js
+++ b/src/utils/accessToken.js
@@ -2,7 +2,10 @@ import _isEmpty from 'lodash/isEmpty'
import { TOKEN } from 'redux/constants'
import { getCookie, setCookie } from './cookie'
-// It's important to first check in local storage, then in session storage, not vice versa.
+// 14 weeks in seconds
+const STORE_AUTH_TOKEN_FOR = 8467200
+
+// It's important to first check in cookie, then in session storage, not vice versa.
export const getAccessToken = () => {
let accessToken = getCookie(TOKEN)
@@ -19,7 +22,7 @@ export const setAccessToken = (token, temporary = false) => {
return
}
- setCookie(TOKEN, token)
+ setCookie(TOKEN, token, STORE_AUTH_TOKEN_FOR)
}
export const removeAccessToken = () => {