aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-06 06:11:55 +0000
committerAdam Soltys <[email protected]>2026-03-06 06:11:55 +0000
commit69d17aea7e0cfdd6429fdbb07c2a1f5c7497e798 (patch)
tree9aa464996cf0c7a0e5b0e277f425a66649f61b8e /routes
parentf96e77c2e54398f9c4fc7a11a8479304170cb65a (diff)
downloadcoinos-server-69d17aea7e0cfdd6429fdbb07c2a1f5c7497e798.tar.gz
coinos-server-69d17aea7e0cfdd6429fdbb07c2a1f5c7497e798.zip
fix pending payment cleanup and login password verification
Skip non-lightning entries in pending payments check and handle malformed password hashes gracefully during login. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/routes/users.ts b/routes/users.ts
index ef2ee449..9820f504 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -405,11 +405,13 @@ export default {
let user = await getUser(username);
if (!isAdmin) {
- if (
- !user ||
- !user.password ||
- !(await Bun.password.verify(password, user.password))
- ) {
+ let verified = false;
+ try {
+ if (user?.password)
+ verified = await Bun.password.verify(password, user.password);
+ } catch (e) {}
+
+ if (!user || !verified) {
await db.incrBy(ipFailKey, 1);
if ((await db.ttl(ipFailKey)) < 0) await db.expire(ipFailKey, 600);
await db.incrBy(fk, 1);