summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater/Web.py
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-13 16:20:34 -0500
committerBen Sima <ben@bsima.me>2025-11-13 16:20:34 -0500
commit83a1777d7869ed6da5e78c878dcc35c95a06c5cf (patch)
tree33410e0c35e2f4cda87302725d96c2909e76722a /Biz/PodcastItLater/Web.py
parent44d6ace4961b167ce9503f3f5a7299a37f3dc8de (diff)
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.
Diffstat (limited to 'Biz/PodcastItLater/Web.py')
-rw-r--r--Biz/PodcastItLater/Web.py29
1 files changed, 16 insertions, 13 deletions
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"],