From 18f6e0f75dc3eea4730ec5e3e62f718706cdae09 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Tue, 5 May 2026 11:52:31 -0700 Subject: [PATCH] add subscribed check back --- server/routers/idp/validateOidcCallback.ts | 27 ++++++++-------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/server/routers/idp/validateOidcCallback.ts b/server/routers/idp/validateOidcCallback.ts index fc8e9b3da..a1ac3607c 100644 --- a/server/routers/idp/validateOidcCallback.ts +++ b/server/routers/idp/validateOidcCallback.ts @@ -333,23 +333,16 @@ export async function validateOidcCallback( .innerJoin(orgs, eq(orgs.orgId, idpOrg.orgId)); allOrgs = idpOrgs.map((o) => o.orgs); - // for (const org of allOrgs) { - // const subscribed = await isSubscribed( - // org.orgId, - // tierMatrix.autoProvisioning - // ); - // if (!subscribed) { - // // filter out the org - // allOrgs = allOrgs.filter((o) => o.orgId !== org.orgId); - - // // return next( - // // createHttpError( - // // HttpCode.FORBIDDEN, - // // "This organization's current plan does not support this feature." - // // ) - // // ); - // } - // } + for (const org of allOrgs) { + const subscribed = await isSubscribed( + org.orgId, + tierMatrix.autoProvisioning + ); + if (!subscribed) { + // filter out the org + allOrgs = allOrgs.filter((o) => o.orgId !== org.orgId); + } + } } else { allOrgs = await db.select().from(orgs); }