Files
myApp/src/app/api/auth/me/route.ts
T
2026-06-14 10:03:34 +07:00

13 lines
301 B
TypeScript

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 });
}