mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 20:51:18 +00:00
admin cannot be a user
This commit is contained in:
parent
7f222baf5f
commit
4971988160
3 changed files with 13 additions and 5 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -95,10 +95,7 @@ const ForgotPasswordView = () => {
|
|||
|
||||
<div className="flex flex-col sm:flex-row gap-2 items-center mt-8 text-sm">
|
||||
<p>Zurück zum</p>
|
||||
<p
|
||||
className="text-yellow hover:underline cursor-pointer"
|
||||
onClick={() => router.push("/login")}
|
||||
>
|
||||
<p className="text-blue underline cursor-pointer" onClick={() => router.push("/login")}>
|
||||
Login
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ const CourseCreateView = ({
|
|||
</Button>
|
||||
</div>
|
||||
<button
|
||||
className="mt-6 w-fit cursor-pointer hover:underline disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
className="mt-6 mb-4 w-fit cursor-pointer hover:underline disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
onClick={() => handleSubmit("draft")}
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue