diff options
author | David Mehren | 2020-09-25 22:39:30 +0200 |
---|---|---|
committer | GitHub | 2020-09-25 22:39:30 +0200 |
commit | 3461993ee05d09106e276e606b143d472908b166 (patch) | |
tree | c17c788b6f39f3ae91e249f48cc653b3d13b6c0b /public/js/lib/common | |
parent | f862b7a1e44c1101a921f19bca4d8d8063eb25ce (diff) | |
parent | 4ece86f0efa1f8f3e4dab0abf810800a045ce632 (diff) |
Merge pull request #486 from codimd/feature/cookie-policy
Diffstat (limited to 'public/js/lib/common')
-rw-r--r-- | public/js/lib/common/constant.ejs | 2 | ||||
-rw-r--r-- | public/js/lib/common/login.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/public/js/lib/common/constant.ejs b/public/js/lib/common/constant.ejs index 114a9077..2a32c333 100644 --- a/public/js/lib/common/constant.ejs +++ b/public/js/lib/common/constant.ejs @@ -8,3 +8,5 @@ window.allowedUploadMimeTypes = <%- JSON.stringify(allowedUploadMimeTypes) %> window.linkifyHeaderStyle = '<%- linkifyHeaderStyle %>' window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>' + +window.cookiePolicy = '<%- cookiePolicy %>' diff --git a/public/js/lib/common/login.js b/public/js/lib/common/login.js index 931c115f..3f7a3e4d 100644 --- a/public/js/lib/common/login.js +++ b/public/js/lib/common/login.js @@ -20,12 +20,12 @@ export function resetCheckAuth () { export function setLoginState (bool, id) { Cookies.set('loginstate', bool, { expires: 365, - sameSite: 'strict' + sameSite: window.cookiePolicy }) if (id) { Cookies.set('userid', id, { expires: 365, - sameSite: 'strict' + sameSite: window.cookiePolicy }) } else { Cookies.remove('userid') |