11 lines
319 B
TypeScript
11 lines
319 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { getCurrentUser } from '@/lib/server/auth';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export async function GET() {
|
|
const user = await getCurrentUser();
|
|
if (!user) return NextResponse.json({ user: null }, { status: 401 });
|
|
return NextResponse.json({ user });
|
|
}
|