Fondation

This commit is contained in:
alma 2026-01-16 23:28:58 +01:00
parent a0b11c7b5f
commit 2cfcc60b65

View File

@ -23,8 +23,7 @@ const CACHE_TTL = 60 * 1000;
const emailListCache: Record<string, EmailCacheEntry> = {};
export async function GET(request: Request) {
try {
// Authenticate user
// Authenticate user (declare outside try to access in catch)
const session = await getServerSession(authOptions);
if (!session || !session.user?.id) {
return NextResponse.json(
@ -33,6 +32,8 @@ export async function GET(request: Request) {
);
}
try {
// Extract query parameters
const { searchParams } = new URL(request.url);
const page = parseInt(searchParams.get("page") || "1");