Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Use case-insensitive plan mapping

Edward Cui3b3e91db7219
diff --git a/server/src/lib/subscriptionUtils.ts b/server/src/lib/subscriptionUtils.ts
index 3629d3905..407c37680 100644
--- a/server/src/lib/subscriptionUtils.ts
+++ b/server/src/lib/subscriptionUtils.ts
@@ -16,21 +16,23 @@ export interface SubscriptionInfo {
}
export function getTierInfo(planName: string): TierInfo {
- if (planName === "free") {
+ const normalizedPlanName = planName.trim().toLowerCase();
+
+ if (normalizedPlanName === "free") {
return {
tier: "Free",
monthsAllowed: 6,
};
}
- if (planName.startsWith("standard")) {
+ if (normalizedPlanName.startsWith("standard")) {
return {
tier: "Standard",
monthsAllowed: 24,
};
}
- if (planName.startsWith("pro")) {
+ if (normalizedPlanName.startsWith("pro")) {
return {
tier: "Pro",
monthsAllowed: 60,