From 036b195af98124fb247445cb21bc5f5790d82809 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 19 Mar 2019 14:01:38 +0100 Subject: [PATCH] Fixed upgrade not updating member state on reload no-issue The problem here is that upgrade would recieve the same token from the localStorage cache, rather than a brand new token with the plan info. --- ghost/sdk/theme-dropin/src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ghost/sdk/theme-dropin/src/index.js b/ghost/sdk/theme-dropin/src/index.js index 63073f440d..bbdd0f554b 100644 --- a/ghost/sdk/theme-dropin/src/index.js +++ b/ghost/sdk/theme-dropin/src/index.js @@ -88,6 +88,15 @@ function setupMembersListeners() { function upgrade(event) { event.preventDefault(); members.upgrade() + .then(() => { + return members.getToken({ + audience: tokenAudience, + fresh: true + }).then(function (token) { + setCookie(token); + return true; + }); + }) .then(reload); }