mirror of
https://github.com/requarks/wiki.git
synced 2026-08-26 21:27:10 -05:00
fix: add cookie secure flag when site is using https
This commit is contained in:
@@ -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 } : {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user