diff options
author | Erik Michelson | 2020-08-27 02:04:49 +0200 |
---|---|---|
committer | Erik Michelson | 2020-08-27 02:04:49 +0200 |
commit | 824f910bfe39b8d789ca3edcfca44b66f603a81c (patch) | |
tree | 4038ca3553f9487eb1c476fa1d7b54355bd341b7 /public/js/lib/common | |
parent | 23d54b8b4b3a9587220c9211d2a92c22609a4de8 (diff) |
Add config option for cookie SameSite policy
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
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') |