feat: improve address credential connections

This commit is contained in:
Dream Hunter
2026-04-30 15:33:06 +08:00
committed by GitHub
parent 347be5c762
commit 796a5e4ac5
32 changed files with 854 additions and 118 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ export default {
return c.text(msgs.InvalidAddressTokenMsg, 400);
}
// 更新密码
// NOTE: new_password is the frontend SHA-256 hash, stored directly in address.password.
const { success } = await c.env.DB.prepare(
`UPDATE address SET password = ?, updated_at = datetime('now') WHERE id = ?`
).bind(new_password, address_id).run();
@@ -67,7 +67,7 @@ export default {
return c.text(msgs.AddressNotFoundMsg, 404);
}
// 验证密码
// NOTE: password is the frontend SHA-256 hash, compared directly with address.password.
if (address.password !== password) {
return c.text(msgs.InvalidEmailOrPasswordMsg, 401);
}