fix(licensing): resolve Admiral variant detection and lifetime license handling (#376)

* fix(licensing): resolve Admiral variant detection and lifetime license handling

The Lemon Squeezy variant name for Admiral licenses contains "Admiral"
(not "Team"), but getVariant() only checked for "team" and "personal".
This caused Admiral licenses to be misidentified as Skipper, locking all
Admiral-exclusive features.

- Map "admiral" variant names to internal "team" value, "skipper" to "personal"
- Add isLifetime field to LicenseInfo API response
- Hide "Manage Subscription" button for lifetime licenses (no billing portal)
- Show "Duration: Lifetime" instead of empty renewal date
- Hide upgrade cards for active Admiral users
- Add 23 unit tests covering variant resolution, tier computation, and lifetime detection
- Add troubleshooting entries for wrong tier label, locked features, and billing portal errors

* fix(licensing): address code review findings

- Fix nested ternary in LicenseSection JSX; restore conditional rendering
  to avoid showing an empty "N/A" row for non-subscription states
- Clean up test file: use shared svc variable, remove redundant comments,
  add trialDaysRemaining assertions, rename describe block
This commit is contained in:
Anso
2026-04-05 07:00:21 -04:00
committed by GitHub
parent f516275834
commit f841c402b2
8 changed files with 310 additions and 22 deletions
+7 -1
View File
@@ -75,9 +75,13 @@ Once your license is active, you can manage your subscription in two ways:
- **From the profile menu:** Click your profile icon in the top bar and select **Billing** for quick access to the same portal.
<Frame>
<img src="/images/licensing/license-active.png" alt="License settings showing an active Admiral subscription with Manage Subscription button" />
<img src="/images/licensing/license-admiral-active.png" alt="License settings showing an active Admiral subscription with Manage Subscription button" />
</Frame>
### Lifetime licenses
Lifetime licenses do not have a recurring subscription, so the **Manage Subscription** button is not shown. Instead, the license card displays **Duration: Lifetime** to confirm your license never expires. All other features (deactivation, multi-node enforcement, validation) work the same as subscription licenses.
## Multi-node license enforcement
If you manage multiple servers through Sencho's [multi-node feature](/features/multi-node), you only need a license on your **primary instance**. All remote nodes automatically inherit the primary's license tier for proxied requests. No per-node activation is required.
@@ -93,3 +97,5 @@ To transfer your license to a different instance:
3. On your new instance, activate the same license key.
Deactivation reverts the current instance to the Community tier immediately.
Having trouble with your license? See the [Troubleshooting](/operations/troubleshooting#license-tier-shows-the-wrong-name) page for solutions to common licensing issues.
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+33
View File
@@ -154,6 +154,39 @@ To re-test connectivity after making changes, open **Profile > Settings > Nodes*
---
## License tier shows the wrong name
**Symptom:** The license card in **Settings > License** shows the wrong tier name (e.g. "Sencho Skipper" when you purchased Admiral).
**Cause:** Older versions of Sencho could misidentify certain license variant names from the payment provider.
**Fix:** Update to the latest version of Sencho and restart. The correct tier name will appear automatically in **Settings > License**.
---
## Paid features are still locked after activation
**Symptom:** Features remain locked even though you activated a valid license key.
**Checks in order:**
1. Open **Settings > License** and verify it shows your license as **active** with the correct tier name.
2. If the tier shows "Skipper" but you purchased Admiral, this is the same variant identification issue described above. Update Sencho to the latest version to resolve it.
3. If the tier shows correctly but features are still locked, restart the Sencho container.
---
## "No billing portal available" when clicking Manage Subscription
**Symptom:** Clicking **Manage Subscription** shows an error about no billing portal being available.
**Possible causes:**
- **Lifetime license:** Lifetime licenses do not have a billing portal. This is expected behavior. In the latest version, the **Manage Subscription** button is hidden for lifetime licenses.
- **Network issues:** If your Sencho instance cannot reach the internet, the billing portal URL cannot be fetched. Check your instance's outbound connectivity and try again.
---
## Paid features return 403 on remote nodes
**Symptom:** A Skipper or Admiral feature works on the local node but returns a 403 error when you switch to a remote node.