Right now we load a portal session every time the user loads the app and we only cache it for 60 seconds which means we generate a TON of them. This isn't good practice and they should really be generated jit-in-time when the user requests it.
Changes
This PR updates the stripe_portal_url in the billing response to be a fixed endpoint from the API that the client can redirect to, which will generate the portal session and redirect the user to. No other changes have been made. Nice and simple :)
I updated the fixtures to match this pattern and added a test for portal endpoint.
Problem
Right now we load a portal session every time the user loads the app and we only cache it for 60 seconds which means we generate a TON of them. This isn't good practice and they should really be generated jit-in-time when the user requests it.
Changes
This PR updates the
stripe_portal_url
in the billing response to be a fixed endpoint from the API that the client can redirect to, which will generate the portal session and redirect the user to. No other changes have been made. Nice and simple :)I updated the fixtures to match this pattern and added a test for portal endpoint.
đ Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?
Tested manually and added a test.