chore(cookies): debug (revert this)

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-12-19 21:38:57 +01:00
parent 1883ec2170
commit f28802b1c2
6 changed files with 113 additions and 16 deletions

View File

@@ -32,4 +32,36 @@ export const userRouter = createTRPCRouter({
return updatedUser;
}),
debugPostCookie: protectedProcedure
.input(
z.object({
sameSite: z.enum(['lax', 'strict', 'none']),
domain: z.string(),
}),
)
.mutation(async ({ ctx, input }) => {
ctx.setCookie('debugCookie', new Date().toISOString(), {
domain: input.domain,
sameSite: input.sameSite,
httpOnly: true,
secure: true,
path: '/',
});
}),
debugGetCookie: protectedProcedure
.input(
z.object({
sameSite: z.enum(['lax', 'strict', 'none']),
domain: z.string(),
}),
)
.query(async ({ ctx, input }) => {
ctx.setCookie('debugCookie', new Date().toISOString(), {
domain: input.domain,
sameSite: input.sameSite,
httpOnly: true,
secure: true,
path: '/',
});
}),
});