Bug Fix: 'Manage Billing' Button Now Works in Settings
Bug Fix: 'Manage Billing' Button Now Works in Settings
Version: 1.0.23
What happened
In the account settings page (/dashboard/settings), the Manage Billing button was implemented as a plain HTML anchor tag pointing to /api/billing/portal:
// src/app/dashboard/settings/page.tsx (line 30 — before fix)
<a href="/api/billing/portal">Manage Billing</a>
However, no GET route handler was registered at src/app/api/billing/portal/route.ts. The only billing portal logic in the codebase lived inside a tRPC mutation:
// src/lib/routers/billing.ts
billing.createBillingPortal // tRPC mutation — not a REST endpoint
As a result, every click on Manage Billing returned a 404 Not Found response, making it impossible for users to reach the Stripe customer portal.
What was fixed
The settings page button has been updated to call the billing.createBillingPortal tRPC mutation on the client side and redirect the browser to the URL returned by Stripe:
// src/app/dashboard/settings/page.tsx (after fix)
const createPortal = trpc.billing.createBillingPortal.useMutation({
onSuccess(data) {
window.location.href = data.url;
},
});
<button onClick={() => createPortal.mutate()}>
Manage Billing
</button>
Alternatively, a proper GET route handler can be added at src/app/api/billing/portal/route.ts that creates a Stripe billing portal session and issues a redirect — either approach resolves the 404.
Who was affected
All users who clicked Manage Billing in Settings were affected. This button is the only entry point to the Stripe customer portal, meaning affected users could not:
- Update a payment method or credit card
- Download or view past invoices
- Change their subscription plan
- Cancel their subscription
What to do
No action is required on your part. After updating to v1.0.23 the button works as expected. Click Settings → Manage Billing and you will be taken directly to your Stripe billing portal.
Reporting issues
If you continue to experience problems accessing the billing portal after this update, please contact support with your account email so we can investigate further.