From 5df270a471cd2e725ea0dab65566658b8c161e12 Mon Sep 17 00:00:00 2001 From: beilunyang <786220806@qq.com> Date: Fri, 17 Jan 2025 19:11:01 +0800 Subject: [PATCH] fix: Users logging in with a password can't get their mailbox --- app/api/emails/route.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/api/emails/route.ts b/app/api/emails/route.ts index ddad1f6..950ac6b 100644 --- a/app/api/emails/route.ts +++ b/app/api/emails/route.ts @@ -14,15 +14,11 @@ export async function GET(request: Request) { const { searchParams } = new URL(request.url) const cursor = searchParams.get('cursor') - if (!session?.user?.email) { - return NextResponse.json({ emails: [], nextCursor: null, total: 0 }) - } - const db = createDb() try { const baseConditions = and( - eq(emails.userId, session.user.id!), + eq(emails.userId, session!.user!.id!), gt(emails.expiresAt, new Date()) )