Skip to content

Commit 3e078e4

Browse files
authored
Allow new strategies to existing sessions cleanerly (sp!) (#2077)
* Up dev limiter just a bit since it's too short sometimes. Post #1893 Auto-merge
1 parent 72cd8e0 commit 3e078e4

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

controllers/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ exports.callback = function (aReq, aRes, aNext) {
463463
aUser.authed = now;
464464

465465
// Check probationary status vs lastAuthed for alt IP circumvention prevention
466-
if (aUser._probationary && lastAuthed) {
466+
if (aUser._probationary && lastAuthed && !newstrategy) {
467467
if (!moment().isAfter(moment(lastAuthed).add(waitAuthCapMin, 'minutes'))) {
468468
aUser.save(function (aErr, aUser) {
469469
if (aErr) {

models/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"pro": 15
5050
},
5151
"waitAuthCapMin": {
52-
"dev": 1,
52+
"dev": 2,
5353
"pro": 1440
5454
},
5555
"waitCaptchaCapMin": {

routes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ var authCapLimiter = rateLimit({
256256
retryAfter: waitAuthCapMin * 60 + (isDev ? fudgeSec : fudgeMin)
257257
}
258258
});
259+
},
260+
skip: function (aReq, aRes) {
261+
if (aReq.session.newstrategy) {
262+
// NOTE: Still counting by design
263+
return true;
264+
}
259265
}
260266
});
261267

0 commit comments

Comments
 (0)