1
0
Fork 0
mirror of synced 2024-07-21 06:05:52 +12:00

Merge pull request #2791 from Budibase/rory/fixes

Honour cookie domain on empty values
This commit is contained in:
Rory Powell 2021-09-29 13:53:24 +01:00 committed by GitHub
commit 0183a55216

View file

@ -67,10 +67,9 @@ exports.getCookie = (ctx, name) => {
* @param {string|object} value The value of cookie which will be set.
*/
exports.setCookie = (ctx, value, name = "builder") => {
if (!value) {
ctx.cookies.set(name)
} else {
if (value) {
value = jwt.sign(value, options.secretOrKey)
}
const config = {
maxAge: Number.MAX_SAFE_INTEGER,
@ -85,7 +84,6 @@ exports.setCookie = (ctx, value, name = "builder") => {
ctx.cookies.set(name, value, config)
}
}
/**
* Utility function, simply calls setCookie with an empty string for value