Skip to content

Commit

Permalink
Added Logic to allow Username and IP to be used for RateLimiting
Browse files Browse the repository at this point in the history
  • Loading branch information
clackner-gpa authored and polonel committed Aug 19, 2022
1 parent 8ab0417 commit 38e3fae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ mainController.loginPost = async function (req, res, next) {
if (process.env.USE_XFORWARDIP == 'true')
ipAddress= req.headers["x-forwarded-for"]


if (process.env.USE_USERRATELIMIT == 'true')
ipAddress = ipAddress + req.body['username']

const [resEmailAndIP] = await Promise.all([limiterSlowBruteByIP.get(ipAddress)])

Expand Down

0 comments on commit 38e3fae

Please sign in to comment.