diff --git a/src/app/api/auth/register/route.ts b/src/app/api/auth/register/route.ts index 1b96dce..edfae97 100644 --- a/src/app/api/auth/register/route.ts +++ b/src/app/api/auth/register/route.ts @@ -12,6 +12,17 @@ export async function POST(request: Request) { return NextResponse.json({ error: "Pflichtfelder fehlen" }, { status: 400 }); } + const existingManager = await prisma.manager.findUnique({ + where: { email }, + }); + + if (existingManager) { + return NextResponse.json( + { error: "Ein Manager kann nicht gleichzeitig ein User sein" }, + { status: 409 } + ); + } + const supabase = await createClient(); const { data, error } = await supabase.auth.signUp({ diff --git a/src/modules/auth/ui/views/forgot-password-view.tsx b/src/modules/auth/ui/views/forgot-password-view.tsx index 5458145..632114e 100644 --- a/src/modules/auth/ui/views/forgot-password-view.tsx +++ b/src/modules/auth/ui/views/forgot-password-view.tsx @@ -95,10 +95,7 @@ const ForgotPasswordView = () => {
Zurück zum
-router.push("/login")} - > +
router.push("/login")}> Login