refactor(validation): restucture api input and output validation
Some checks failed
docker-build / docker (pull_request) Has been cancelled
container-scan / Container Scan (pull_request) Has been cancelled

This commit is contained in:
Dominik 2025-06-18 21:36:30 +02:00
parent b0cb343480
commit c5bcb41e69
Signed by: dominik
GPG key ID: 06A4003FC5049644
34 changed files with 1890 additions and 1802 deletions

View file

@ -8,7 +8,7 @@ import Authentik from 'next-auth/providers/authentik';
import { PrismaAdapter } from '@auth/prisma-adapter';
import { prisma } from '@/prisma';
import { loginClientSchema } from './lib/validation/user';
import { loginSchema } from '@/lib/auth/validation';
import { ZodError } from 'zod/v4';
class InvalidLoginError extends CredentialsSignin {
@ -37,7 +37,7 @@ const providers: Provider[] = [
if (process.env.DISABLE_PASSWORD_LOGIN) return null;
try {
const { email, password } = await loginClientSchema.parseAsync(c);
const { email, password } = await loginSchema.parseAsync(c);
const user = await prisma.user.findFirst({
where: { OR: [{ email }, { name: email }] },