const t = initTRPC.context<Context>().create();
const publicProcedure = t.procedure;
const router = t.router;
export const authRouter = router({
register: publicProcedure.mutation(async ({ ctx }) => {
const token = "exampleToken"; // Example token generation
setCookie(ctx, "token", token, {
path: "/",
secure: process.env.NODE_ENV === "production",
httpOnly: true,
maxAge: 60 * 60 * 24 * 30,
sameSite: "Lax",
});
return { message: "Registration successful!" };
}),
});
const t = initTRPC.context<Context>().create();
const publicProcedure = t.procedure;
const router = t.router;
export const authRouter = router({
register: publicProcedure.mutation(async ({ ctx }) => {
const token = "exampleToken"; // Example token generation
setCookie(ctx, "token", token, {
path: "/",
secure: process.env.NODE_ENV === "production",
httpOnly: true,
maxAge: 60 * 60 * 24 * 30,
sameSite: "Lax",
});
return { message: "Registration successful!" };
}),
});