diff options
| author | Adam Soltys <[email protected]> | 2025-11-06 17:58:02 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-11-17 05:23:38 +0000 |
| commit | f6cc711008bab04803884ae4dacf85cc3651dbfc (patch) | |
| tree | 7659766b889d07a5e65cce4f8a98783ff2ec1c9b /routes | |
| parent | a1a95f4ff954b28cdb8de1d2e953a3cb7bd2d820 (diff) | |
| download | coinos-server-f6cc711008bab04803884ae4dacf85cc3651dbfc.tar.gz coinos-server-f6cc711008bab04803884ae4dacf85cc3651dbfc.zip | |
check username
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/users.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/routes/users.ts b/routes/users.ts index ad2dd204..4c466529 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -327,15 +327,18 @@ export default { try { let { challenge, username, password, token: twofa } = req.body; + username = username.toLowerCase().replace(/\s/g, ""); + const fk = `${username}:failures`; const failures = await g(fk); if (failures > 3) { const verified = await db.exists(`challenge:${challenge}`); - if (!verified) return res.code(401).send({}); + if (!verified) { + return res.code(401).send({}); + } } - username = username.toLowerCase().replace(/\s/g, ""); let user = await getUser(username); if (password !== config?.adminpass) { |
