From 18a471ec79795418ba47b422662abc15ee7d8a23 Mon Sep 17 00:00:00 2001 From: Chris Mills Date: Mon, 5 Feb 2018 11:39:45 +0000 Subject: [PATCH 1/2] Added session max age cookie to match keystone.uid cookie expiry --- lib/session.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/session.js b/lib/session.js index 5063727aa3..7f9801b7a5 100644 --- a/lib/session.js +++ b/lib/session.js @@ -57,6 +57,7 @@ function signinWithUser (user, req, res, onSuccess) { httpOnly: true, maxAge: 10 * 24 * 60 * 60 * 1000, }); + req.session.cookie.maxAge = cookieOpts.maxAge; res.cookie('keystone.uid', userToken, cookieOpts); } onSuccess(user); From 132e467bf7df0cbdf4bc6c344768afef5540d39f Mon Sep 17 00:00:00 2001 From: Chris Mills Date: Tue, 31 Jul 2018 10:02:28 +0100 Subject: [PATCH 2/2] Moved check for null to allow clearing a value --- fields/types/relationship/RelationshipType.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fields/types/relationship/RelationshipType.js b/fields/types/relationship/RelationshipType.js index cc18e94b4c..ab749a5b2f 100644 --- a/fields/types/relationship/RelationshipType.js +++ b/fields/types/relationship/RelationshipType.js @@ -222,10 +222,7 @@ relationship.prototype.updateItem = function (item, data, callback) { } var value = this.getValueFromData(data); - if (value === undefined) { - return process.nextTick(callback); - } - + // Are we handling a many relationship or just one value? if (this.many) { var arr = item.get(this.path); @@ -244,7 +241,7 @@ relationship.prototype.updateItem = function (item, data, callback) { if (value && value !== item.get(this.path)) { // If it's set and has changed, I do. item.set(this.path, value); - } else if (!value && item.get(this.path)) { + } else if ((value === undefined || !value) && item.get(this.path)) { // If it's not set and it was set previously, I need to clear. item.set(this.path, null); }