mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
- make cookie time configurable (default: 2 years)
- make cookie https setting configurable (default true in production) - ensure cookie is set to `path: /` to fix redirect problem
This commit is contained in:
parent
309c89ecf8
commit
9bf90bc880
@ -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 = {
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user