first commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { getCurrentUser } from "@/lib/auth";
|
||||
import { jsonError } from "@/lib/api";
|
||||
|
||||
export async function GET() {
|
||||
const user = await getCurrentUser();
|
||||
if (!user) {
|
||||
return jsonError("Unauthorized", 401);
|
||||
}
|
||||
|
||||
return NextResponse.json({ user });
|
||||
}
|
||||
Reference in New Issue
Block a user