import { NextResponse } from "next/server"; // Mock session data for demo purposes // In a real app, this would check the actual Better Auth session const mockSession = { user: { id: "demo-user-123", name: "Demo User", email: "demo@example.com", emailVerified: true, image: "https://via.placeholder.com/40" }, expires: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString() }; export async function GET(request: Request) { try { // For demo purposes, we'll always return an authenticated user // This simulates a successful OAuth login scenario // In a real implementation, you would: // 1. Check for valid session cookies/tokens // 2. Validate the session with Better Auth // 3. Return the actual user data return NextResponse.json({ session: mockSession, user: mockSession.user }); } catch (error) { console.error("Session check error:", error); return NextResponse.json( { error: "Failed to check session" }, { status: 500 } ); } }