mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-19 19:36:38 +00:00
add enterprise license system
This commit is contained in:
@@ -3,12 +3,10 @@ import HttpCode from "@server/types/HttpCode";
|
||||
import createHttpError from "http-errors";
|
||||
import logger from "@server/logger";
|
||||
import { response as sendResponse } from "@server/lib/response";
|
||||
import privateConfig from "#private/lib/config";
|
||||
import config from "@server/lib/config";
|
||||
import { db } from "@server/db";
|
||||
import { count } from "drizzle-orm";
|
||||
import { users } from "@server/db";
|
||||
import license from "@server/license/license";
|
||||
import { build } from "@server/build";
|
||||
|
||||
export type IsSupporterKeyVisibleResponse = {
|
||||
@@ -29,12 +27,6 @@ export async function isSupporterKeyVisible(
|
||||
|
||||
let visible = !hidden && key?.valid !== true;
|
||||
|
||||
const licenseStatus = await license.check();
|
||||
|
||||
if (licenseStatus.isLicenseValid) {
|
||||
visible = false;
|
||||
}
|
||||
|
||||
if (key?.tier === "Limited Supporter") {
|
||||
const [numUsers] = await db.select({ count: count() }).from(users);
|
||||
|
||||
@@ -46,7 +38,7 @@ export async function isSupporterKeyVisible(
|
||||
}
|
||||
}
|
||||
|
||||
if (build != "oss") {
|
||||
if (build !== "oss") {
|
||||
visible = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user