|
|
@ -55,7 +55,7 @@ module.exports = { |
|
|
|
if (res.locals.solvedCaptcha) { |
|
|
|
if (res.locals.solvedCaptcha) { |
|
|
|
//they dont have a valid bypass, but just solved board captcha, so give them a new one
|
|
|
|
//they dont have a valid bypass, but just solved board captcha, so give them a new one
|
|
|
|
const newBypass = await Bypass.getBypass(res.locals.anonymizer, res.locals.pseudoIp, blockBypass.expireAfterUses); |
|
|
|
const newBypass = await Bypass.getBypass(res.locals.anonymizer, res.locals.pseudoIp, blockBypass.expireAfterUses); |
|
|
|
const newBypassId = newBypass.insertedId; |
|
|
|
const newBypassId = newBypass.upsertedId || newBypass.insertedId || res.locals.pseudoIp; |
|
|
|
res.locals.blockBypass = true; |
|
|
|
res.locals.blockBypass = true; |
|
|
|
res.cookie('bypassid', newBypassId.toString(), { |
|
|
|
res.cookie('bypassid', newBypassId.toString(), { |
|
|
|
'maxAge': blockBypass.expireAfterTime, |
|
|
|
'maxAge': blockBypass.expireAfterTime, |
|
|
|