Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Fix middleware logic when auth is required
Luke Vella27bbe6f94703
diff --git a/packages/backend/trpc/trpc.ts b/packages/backend/trpc/trpc.tsindex 9f61987a4..7ca006db5 100644--- a/packages/backend/trpc/trpc.ts+++ b/packages/backend/trpc/trpc.ts@@ -17,7 +17,7 @@ export const publicProcedure = t.procedure;export const middleware = t.middleware;const checkAuthIfRequired = middleware(async ({ ctx, next }) => {- if (process.env.AUTH_REQUIRED === "true" && ctx.session) {+ if (process.env.AUTH_REQUIRED === "true" && ctx.session.user.isGuest) {throw new TRPCError({ code: "UNAUTHORIZED", message: "Login is required" });}return next();