Skip to content

Commit cf6b64e

Browse files
committed
chore: remove console logs and error handlers from trpc routes
1 parent 29429fb commit cf6b64e

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

src/app/api/public/[...trpc]/route.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@ import { appRouter } from "@/server/routers/_app";
33
import { createContext } from "@/server/context";
44

55
const handler = async (req: Request) => {
6-
console.log(`[PUBLIC TRPC] ${req.method} ${req.url}`);
76
return fetchRequestHandler({
87
endpoint: "/api/public/trpc",
98
req,
109
router: appRouter,
1110
createContext: async () => {
1211
const ctx = await createContext({ req });
13-
console.log("[PUBLIC TRPC] Context created");
1412
return ctx;
1513
},
16-
onError: ({ error, path }) => {
17-
console.error(`[PUBLIC TRPC ERROR] path: ${path}, error:`, error);
18-
},
1914
});
2015
};
2116

src/app/api/trpc/[...trpc]/route.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { auth } from "@/auth";
55
import { headers } from "next/headers";
66

77
const handler = async (req: Request) => {
8-
console.log(`[AUTH TRPC] ${req.method} ${req.url}`);
98
const session = await auth.api.getSession({
109
headers: await headers(),
1110
});
@@ -16,14 +15,8 @@ const handler = async (req: Request) => {
1615
router: appRouter,
1716
createContext: async () => {
1817
const ctx = await createContext({ req, session });
19-
console.log(
20-
`[AUTH TRPC] Context created for user: ${session?.user?.email || "anonymous"}`,
21-
);
2218
return ctx;
2319
},
24-
onError: ({ error, path }) => {
25-
console.error(`[AUTH TRPC ERROR] path: ${path}, error:`, error);
26-
},
2720
});
2821
};
2922

0 commit comments

Comments
 (0)