fix: login

This commit is contained in:
Acbox
2026-01-11 20:01:18 +08:00
parent a7e07d7467
commit 4085964be6
5 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -76,11 +76,11 @@ export const validateUser = async (username: string, password: string) => {
return null
}
// 查询数据库中的用户
// 查询数据库中的用户(使用 username 而不是 id
const [user] = await db
.select()
.from(users)
.where(eq(users.id, userId!))
.where(eq(users.username, username))
if (!user) {
return null