Skip to content

Commit

Permalink
Do not check user authenticated on trpc
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed May 8, 2024
1 parent ce1f902 commit f463975
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions apps/builder/app/routes/trpc.$.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
// eslint-disable-next-line import/no-internal-modules
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
import type { ActionFunctionArgs } from "@remix-run/server-runtime";
import { findAuthenticatedUser } from "~/services/auth.server";
import { createContext } from "~/shared/context.server";
import { appRouter } from "~/services/trcp-router.server";

export const action = async ({ request }: ActionFunctionArgs) => {
const authenticatedUser = await findAuthenticatedUser(request);

if (authenticatedUser === null) {
throw new Error("Not authenticated");
}

// https://trpc.io/docs/server/adapters/fetch
const response = await fetchRequestHandler({
req: request,
Expand Down

0 comments on commit f463975

Please sign in to comment.