Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

fix: only require subscription check when Stripe is enabled

Kha Nguyen20eecd682e8e
diff --git a/apps/web/lib/api/isAuthenticatedRequest.ts b/apps/web/lib/api/isAuthenticatedRequest.ts
index af00cb5c..17ba467b 100644
--- a/apps/web/lib/api/isAuthenticatedRequest.ts
+++ b/apps/web/lib/api/isAuthenticatedRequest.ts
@@ -2,6 +2,8 @@ import { NextApiRequest } from "next";
import { getToken } from "next-auth/jwt";
import { prisma } from "@linkwarden/prisma";
+const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY;
+
type Props = {
req: NextApiRequest;
};
@@ -39,7 +41,7 @@ export default async function isAuthenticatedRequest({ req }: Props) {
},
});
- if (findUser && !findUser?.subscriptions) {
+ if (STRIPE_SECRET_KEY && findUser && !findUser?.subscriptions) {
return null;
}