return failed jwt for debugging auth

This commit is contained in:
Avraham Sakal
2025-09-21 19:37:04 -04:00
parent 5bd5fbe9dc
commit edfaabeb0d
+4 -2
View File
@@ -39,12 +39,14 @@ export const publicProcedure = t.procedure;
export const authProcedure = publicProcedure.use(
async ({ ctx: { jwt }, next }) => {
if (!jwt) {
throw new TRPCError({ code: "UNAUTHORIZED" });
throw new TRPCError({
code: "UNAUTHORIZED",
message: JSON.stringify(jwt),
});
}
if (!jwt.id) {
throw new TRPCError({ code: "UNAUTHORIZED" });
}
jwt.email;
return await next({
ctx: { jwt },
});