diff --git a/core/server/services/members/stripe-connect.js b/core/server/services/members/stripe-connect.js index 540f5db4dd..ab9545a9a7 100644 --- a/core/server/services/members/stripe-connect.js +++ b/core/server/services/members/stripe-connect.js @@ -18,7 +18,11 @@ const redirectURI = 'https://stripe.ghost.org'; * @returns {Promise} */ async function getStripeConnectOAuthUrl(setSessionProp, mode = 'live') { - const state = randomBytes(16).toString('hex'); + const randomState = randomBytes(16).toString('hex'); + const state = Buffer.from(JSON.stringify({ + mode, + randomState + })).toString('base64'); await setSessionProp(STATE_PROP, state);