Removed logic to set default urls for checkout

refs https://github.com/TryGhost/Team/issues/1067

Checkout success/cancel URLs are handled by the server, and should only
be passed if we particularly want a custom one!
This commit is contained in:
Fabien egg O'Carroll 2021-12-01 20:11:16 +02:00
parent b26c0aefce
commit 709b5b2af6

View File

@ -216,11 +216,6 @@ function setupGhostApi({siteUrl = window.location.origin}) {
const siteUrlObj = new URL(siteUrl);
const identity = await api.member.identity();
const url = endpointFor({type: 'members', resource: 'create-stripe-checkout-session'});
if (!successUrl) {
const checkoutSuccessUrl = new URL(siteUrl);
checkoutSuccessUrl.searchParams.set('stripe', 'success');
successUrl = checkoutSuccessUrl.href;
}
if (!cancelUrl) {
const checkoutCancelUrl = window.location.href.startsWith(siteUrlObj.href) ? new URL(window.location.href) : new URL(siteUrl);