fixed a bit

This commit is contained in:
bobbert committed 2025-03-11 17:21:46 +00:00
1 parent c6aef07b61
commit d69bee427b
13 files changed
+961 -153

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
// app/api/user/route.js
import { getServerSession } from 'next-auth/next';
import { authOptions } from '../auth/[...nextauth]/route';
export async function GET() {
const session = await getServerSession(authOptions);
if (!session) {
return Response.json({ error: 'Unauthorized' }, { status: 401 });
}
return Response.json({
id: session.user.id,
username: session.user.username,
role: session.user.role
});
}