Skip to content

Commit 5df270a

Browse files
committed
fix: Users logging in with a password can't get their mailbox
1 parent c8d060e commit 5df270a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/api/emails/route.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ export async function GET(request: Request) {
1414
const { searchParams } = new URL(request.url)
1515
const cursor = searchParams.get('cursor')
1616

17-
if (!session?.user?.email) {
18-
return NextResponse.json({ emails: [], nextCursor: null, total: 0 })
19-
}
20-
2117
const db = createDb()
2218

2319
try {
2420
const baseConditions = and(
25-
eq(emails.userId, session.user.id!),
21+
eq(emails.userId, session!.user!.id!),
2622
gt(emails.expiresAt, new Date())
2723
)
2824

0 commit comments

Comments
 (0)