mirror of
https://github.com/beilunyang/moemail.git
synced 2026-09-05 23:36:37 +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 { searchParams } = new URL(request.url)
|
||||||
const cursor = searchParams.get('cursor')
|
const cursor = searchParams.get('cursor')
|
||||||
|
|
||||||
if (!session?.user?.email) {
|
|
||||||
return NextResponse.json({ emails: [], nextCursor: null, total: 0 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const db = createDb()
|
const db = createDb()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const baseConditions = and(
|
const baseConditions = and(
|
||||||
eq(emails.userId, session.user.id!),
|
eq(emails.userId, session!.user!.id!),
|
||||||
gt(emails.expiresAt, new Date())
|
gt(emails.expiresAt, new Date())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user