From 1a20e4f81394eae9fbbecc908d32a6607a74e64a Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 26 Oct 2024 19:35:49 -0600 Subject: [PATCH] refactor: disable endpoints from cloud in self hosted --- apps/dokploy/server/api/routers/auth.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/server/api/routers/auth.ts b/apps/dokploy/server/api/routers/auth.ts index c70b7fd6..73869123 100644 --- a/apps/dokploy/server/api/routers/auth.ts +++ b/apps/dokploy/server/api/routers/auth.ts @@ -122,7 +122,7 @@ export const authRouter = createTRPCRouter({ }); } - if (auth?.confirmationToken) { + if (auth?.confirmationToken && IS_CLOUD) { await sendVerificationEmail(auth.id); throw new TRPCError({ code: "BAD_REQUEST", @@ -352,6 +352,12 @@ export const authRouter = createTRPCRouter({ }), ) .mutation(async ({ ctx, input }) => { + if (!IS_CLOUD) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Functionality not available in cloud version", + }); + } const authR = await db.query.auth.findFirst({ where: eq(auth.confirmationToken, input.confirmationToken), });