mirror of
https://github.com/beilunyang/moemail.git
synced 2025-12-24 11:30:51 +08:00
fix: Users logging in with a password can't get their mailbox
This commit is contained in:
@@ -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())
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user