fix: add cookie secure flag when site is using https

This commit is contained in:
NGPixel
2026-01-08 04:22:22 -05:00
parent 7d4627ba0b
commit 1d0d87af6e
4 changed files with 16 additions and 6 deletions
+9
View File
@@ -1,4 +1,7 @@
/* global WIKI */
const _ = require('lodash')
const { DateTime } = require('luxon')
module.exports = {
/**
@@ -38,5 +41,11 @@ module.exports = {
})
return result
}, {})
},
getCookieOpts () {
return {
expires: DateTime.utc().plus({ days: 365 }).toJSDate(),
...(WIKI.config.host.startsWith('https://') ? { secure: true } : {})
}
}
}