return failed jwt for debugging auth
This commit is contained in:
@@ -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 },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user