chore: merged main

This commit is contained in:
Catalin Pit
2023-12-21 10:14:07 +02:00
41 changed files with 373 additions and 384 deletions

View File

@ -11,6 +11,13 @@ import { ZSignUpMutationSchema, ZVerifyPasswordMutationSchema } from './schema';
export const authRouter = router({
signup: procedure.input(ZSignUpMutationSchema).mutation(async ({ input }) => {
try {
if (process.env.NEXT_PUBLIC_DISABLE_SIGNUP === 'true') {
throw new TRPCError({
code: 'BAD_REQUEST',
message: 'Signups are disabled.',
});
}
const { name, email, password, signature } = input;
const user = await createUser({ name, email, password, signature });