refactor: disable endpoints from cloud in self hosted

This commit is contained in:
Mauricio Siu 2024-10-26 19:35:49 -06:00
parent 250c14738c
commit 1a20e4f813

View File

@ -122,7 +122,7 @@ export const authRouter = createTRPCRouter({
}); });
} }
if (auth?.confirmationToken) { if (auth?.confirmationToken && IS_CLOUD) {
await sendVerificationEmail(auth.id); await sendVerificationEmail(auth.id);
throw new TRPCError({ throw new TRPCError({
code: "BAD_REQUEST", code: "BAD_REQUEST",
@ -352,6 +352,12 @@ export const authRouter = createTRPCRouter({
}), }),
) )
.mutation(async ({ ctx, input }) => { .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({ const authR = await db.query.auth.findFirst({
where: eq(auth.confirmationToken, input.confirmationToken), where: eq(auth.confirmationToken, input.confirmationToken),
}); });