Switch to the new tier system and clean up checks

This commit is contained in:
Owen
2026-02-06 16:27:31 -08:00
parent 0a33043874
commit be60d66ce3
31 changed files with 163 additions and 215 deletions

View File

@@ -13,9 +13,8 @@ import { generateId } from "@server/auth/sessions/app";
import { usageService } from "@server/lib/billing/usageService";
import { FeatureId } from "@server/lib/billing";
import { build } from "@server/build";
import { getOrgTierData } from "#dynamic/lib/billing";
import { TierId } from "@server/lib/billing/tiers";
import { calculateUserClientsForOrgs } from "@server/lib/calculateUserClientsForOrgs";
import { isSubscribed } from "@server/private/lib/isSubscribed";
const paramsSchema = z.strictObject({
orgId: z.string().nonempty()
@@ -132,9 +131,8 @@ export async function createOrgUser(
);
} else if (type === "oidc") {
if (build === "saas") {
const { tier } = await getOrgTierData(orgId);
const subscribed = tier === TierId.STANDARD;
if (!subscribed) {
const subscribed = await isSubscribed(orgId);
if (subscribed) {
return next(
createHttpError(
HttpCode.FORBIDDEN,