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
@@ -42,13 +42,14 @@ export const useCheckoutSession = (
}
// Fetch current license key for upgrades
// Only include if it's a valid PRO/ENTERPRISE license (not NORMAL/free tier)
let existingLicenseKey: string | undefined;
try {
const licenseInfo = await licenseService.getLicenseInfo();
if (licenseInfo && licenseInfo.licenseKey) {
if (licenseInfo?.licenseType && licenseInfo.licenseType !== 'NORMAL' && licenseInfo.licenseKey) {
existingLicenseKey = licenseInfo.licenseKey;
setCurrentLicenseKey(existingLicenseKey);
console.log('Found existing license for upgrade');
console.log('Found existing valid license for upgrade');
}
} catch (error) {
console.warn('Could not fetch license info, proceeding as new license:', error);