Capture emaill when the license is default or invalid (#4998)

Stripe checkout captures email if the license is the default or invalid.
This commit is contained in:
ConnorYoh
2025-11-25 14:33:19 +00:00
committed by GitHub
parent a8db2fda18
commit 2ab7945130
4 changed files with 56 additions and 24 deletions
@@ -88,8 +88,13 @@ const AdminPlanSection: React.FC = () => {
const handleManageClick = useCallback(async () => {
try {
// Only allow PRO or ENTERPRISE licenses to access billing portal
if (!licenseInfo?.licenseType || licenseInfo.licenseType === 'NORMAL') {
throw new Error('No valid license found. Please purchase a license before accessing the billing portal.');
}
if (!licenseInfo?.licenseKey) {
throw new Error('No license key found. Please activate a license first.');
throw new Error('License key missing. Please contact support.');
}
// Create billing portal session with license key