Merge pull request #4184 from Ocelot-Social-Community/fix_cookie

Fix cookie
This commit is contained in:
Ulf Gebhardt 2021-02-01 12:40:02 +01:00 committed by GitHub
commit e5fce03ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,9 @@ const sentry = {
const options = {
VERSION: process.env.VERSION || pkg.version,
DESCRIPTION: process.env.DESCRIPTION || pkg.description,
// Cookies
COOKIE_EXPIRE_TIME: process.env.COOKIE_EXPIRE_TIME || 730, // Two years by default
COOKIE_HTTPS_ONLY: process.env.COOKIE_HTTPS_ONLY || process.env.NODE_ENV === 'production', // ensure true in production if not set explicitly
}
const CONFIG = {

View File

@ -191,7 +191,13 @@ export default {
apollo: {
tokenName: metadata.COOKIE_NAME, // optional, default: apollo-token
cookieAttributes: {
expires: 1, // optional, default: 7 (days)
expires: CONFIG.COOKIE_EXPIRE_TIME, // optional, default: 7 (days)
/** * Define the path where the cookie is available. Defaults to '/' */
// For some reason this can vary - lets see if setting this helps.
path: '/', // optional
/** * A Boolean indicating if the cookie transmission requires a
* secure protocol (https). Defaults to false. */
secure: CONFIG.COOKIE_HTTPS_ONLY,
},
// includeNodeModules: true, // optional, default: false (this includes graphql-tag for node_modules folder)