diff --git a/ghost/portal/src/index.js b/ghost/portal/src/index.js index e23982ce6b..9a48890b1f 100644 --- a/ghost/portal/src/index.js +++ b/ghost/portal/src/index.js @@ -9,8 +9,17 @@ function addRootDiv() { document.body.appendChild(elem); } +function handleTokenUrl() { + const url = new URL(window.location); + if (url.searchParams.get('token')) { + url.searchParams.delete('token'); + window.history.replaceState({}, document.title, url.href); + } +} + function init(data) { addRootDiv(); + handleTokenUrl(); ReactDOM.render(