From da3f92fac4564643113b7722f64e3dd3f8c4af7e Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Thu, 12 Mar 2020 14:15:54 +0200 Subject: [PATCH] Updated URL and response handling for identity token no-issue This just keeps the admin in line with the changes made in https://github.com/TryGhost/Ghost/pull/11559/files --- ghost/admin/app/components/gh-billing-iframe.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/gh-billing-iframe.js b/ghost/admin/app/components/gh-billing-iframe.js index 16afcc7a65..9aa8a95b20 100644 --- a/ghost/admin/app/components/gh-billing-iframe.js +++ b/ghost/admin/app/components/gh-billing-iframe.js @@ -13,9 +13,10 @@ export default Component.extend({ let iframe = this.element.querySelector('#billing-frame'); window.addEventListener('message', (event) => { if (event && event.data && event.data.request === 'token') { - const ghostIdentityUrl = this.get('ghostPaths.url').api('ghost-identity'); + const ghostIdentityUrl = this.get('ghostPaths.url').api('identities'); - this.ajax.post(ghostIdentityUrl).then(({token}) => { + this.ajax.request(ghostIdentityUrl).then((response) => { + const token = response && response.identities && response.identities[0] && response.identities[0].token; iframe.contentWindow.postMessage({ request: 'token', response: token