This commit is contained in:
root
2025-12-20 19:00:42 +01:00
parent 9871289bfb
commit e1a0966dee
23 changed files with 1878 additions and 48 deletions

View File

@@ -0,0 +1,22 @@
import { NextResponse } from 'next/server'
import { getCurrentUser } from '@/lib/auth'
// GET /api/auth/session - Get current session/user
export async function GET() {
try {
const user = await getCurrentUser()
if (!user) {
return NextResponse.json({ user: null }, { status: 200 })
}
return NextResponse.json({ user }, { status: 200 })
} catch (error) {
console.error('Error getting session:', error)
return NextResponse.json(
{ error: 'Failed to get session' },
{ status: 500 }
)
}
}