fix: error when login in with different email

This commit is contained in:
Ou 2024-11-26 19:18:32 +08:00
parent 3d7b49d991
commit 53e57c1d2f

View File

@ -29,7 +29,7 @@ export class UserTable {
.run(id, email, "", type, now, now)
logger.success(`add user ${id}`)
} else if (u.email !== email && u.type !== type) {
await this.db.prepare(`UPDATE user SET email = ?, updated = ? WHERE id = ?`).run(id, email, now)
await this.db.prepare(`UPDATE user SET email = ?, updated = ? WHERE id = ?`).run(email, now, id)
logger.success(`update user ${id} email`)
} else {
logger.info(`user ${id} already exists`)