Full project added

This commit is contained in:
Marcelo Dares
2025-12-17 20:24:06 +00:00
parent fc2e4fd15a
commit 0e9b2dd72d
36 changed files with 2050 additions and 84 deletions

23
app/api/me/route.ts Normal file
View File

@@ -0,0 +1,23 @@
import { NextResponse } from "next/server";
import { requireSession } from "@/lib/auth/requireSession";
import { prisma } from "@/lib/prisma";
export async function GET() {
try {
const { userId, orgId } = await requireSession();
const user = await prisma.user.findUnique({
where: { id: userId },
select: { id: true, email: true, name: true },
});
const org = await prisma.org.findUnique({
where: { id: orgId },
select: { id: true, name: true, slug: true },
});
return NextResponse.json({ ok: true, user, org });
} catch {
return NextResponse.json({ ok: false }, { status: 401 });
}
}