Before: 'Gérer l'abonnement' opened the generic Customer Portal. If the user cancelled, the portal's 'return_url' was just a button label — nothing auto-redirected back to Freedge, so the user was stranded on billing.stripe.com after clicking 'Cancel'. Now: dedicated 'Annuler' button on the Profile SubscriptionCard that calls a new backend endpoint POST /stripe/portal/cancel. This creates a portal session with flow_data.type = 'subscription_cancel' deep-linked to the user's active subscription, plus after_completion.type = 'redirect' so Stripe automatically redirects to /subscription/cancelled when the cancellation is confirmed. New page /subscription/cancelled: - Animated heart badge (spring + pulsing halo) - 'À bientôt, on l'espère' title - Info box showing the period-end date (fetched via sync on mount) so the user knows they still have access until the end of the already-paid period - Re-engagement message + 'Retour aux recettes' / 'Voir les plans' CTAs - On mount: calls /stripe/sync so the DB is updated immediately (doesn't wait for the customer.subscription.updated webhook) Profile SubscriptionCard paid-state footer now has two buttons side by side: 'Gérer' (outline) and 'Annuler' (ghost with red hover). Backend verified: Stripe SDK v12 supports flow_data.after_completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default tseslint.config({
extends: [
// Remove ...tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,
],
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default tseslint.config({
plugins: {
// Add the react-x and react-dom plugins
'react-x': reactX,
'react-dom': reactDom,
},
rules: {
// other rules...
// Enable its recommended typescript rules
...reactX.configs['recommended-typescript'].rules,
...reactDom.configs.recommended.rules,
},
})