fix: Users logging in with a password can't get their mailbox

This commit is contained in:
beilunyang
2025-01-17 19:11:01 +08:00
parent c8d060e740
commit 5df270a471

View File

@@ -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())
)