From 83a1777d7869ed6da5e78c878dcc35c95a06c5cf Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 13 Nov 2025 16:20:34 -0500 Subject: Fix CORS error for Stripe portal redirect Change 'Manage Subscription' from HTMX link to regular form POST. HTMX AJAX requests can't follow redirects to external domains like Stripe. --- Biz/PodcastItLater/Web.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'Biz/PodcastItLater/Web.py') diff --git a/Biz/PodcastItLater/Web.py b/Biz/PodcastItLater/Web.py index 9fe328b..b7870a1 100644 --- a/Biz/PodcastItLater/Web.py +++ b/Biz/PodcastItLater/Web.py @@ -1220,22 +1220,25 @@ def account_page(request: Request) -> html.html | RedirectResponse: ], ) if tier == "free" - else html.a( - html.i( + else html.form( + html.button( + html.i( + classes=[ + "bi", + "bi-gear-fill", + "me-1", + ], + ), + "Manage Subscription", + type="submit", classes=[ - "bi", - "bi-gear-fill", - "me-1", + "btn", + "btn-primary", + "me-2", ], ), - "Manage Subscription", - href="#", - hx_post="/billing/portal", - classes=[ - "btn", - "btn-primary", - "me-2", - ], + method="post", + action="/billing/portal", ), ), classes=["card-body"], -- cgit v1.2.3