Skip to content

Commit

Permalink
adding env variable for the cookies
Browse files Browse the repository at this point in the history
The cookie domain needs to be called out. specifying it as COOKIE_DOMAIN. This needs to be passed via docker.
  • Loading branch information
earlng committed Jun 2, 2021
1 parent 1d6dee8 commit e4099cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/naturalcrit/account.actions.js
Expand Up @@ -52,11 +52,11 @@ const AccountActions = {
createSession : (token) => {
// MAKE COOKIE WORK WITH LOCALHOST FOR TESTING
//document.cookie = `nc_session=${token};max-age=${60*60*24*365}; path=/; samesite=lax`;
document.cookie = `nc_session=${token}; max-age=${60*60*24*365}; path=/; samesite=lax; domain=${window.domain}`;
document.cookie = `nc_session=${token}; max-age=${60*60*24*365}; path=/; samesite=lax; domain=${process.env.COOKIE_DOMAIN}`;
},

removeSession : () => {
document.cookie = `nc_session=; expires=Thu, 01 Jan 1970 00:00:01 GMT; samesite=lax; domain=${window.domain}`;
document.cookie = `nc_session=; expires=Thu, 01 Jan 1970 00:00:01 GMT; samesite=lax; domain=${process.env.COOKIE_DOMAIN}`;
//document.cookie = `nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;domain=${window.domain};`;
}
}
Expand Down

0 comments on commit e4099cf

Please sign in to comment.