removed oAuth endpoint from dispatch, started oAuth endpoints for moodle

This commit is contained in:
PxlLoewe
2025-02-25 23:23:18 +01:00
parent 4c35257cf0
commit b81bab1dc2
7 changed files with 137 additions and 182 deletions

View File

@@ -0,0 +1,21 @@
import { NextRequest, NextResponse } from "next/server";
import { getServerSession } from "../auth/[...nextauth]/auth";
import { prisma } from "@repo/db";
export const GET = async (req: NextRequest) => {
const session = await getServerSession();
if (!session) {
return {
status: 401,
body: "Unauthorized",
};
}
const user = await prisma.user.findUnique({
where: {
id: session.user.id,
},
});
return NextResponse.json(user);
};