|
|
@ -5,7 +5,8 @@ const { Bypass } = require(__dirname+'/../../../db/') |
|
|
|
, config = require(__dirname+'/../../misc/config.js') |
|
|
|
, config = require(__dirname+'/../../misc/config.js') |
|
|
|
, deleteTempFiles = require(__dirname+'/../../file/deletetempfiles.js') |
|
|
|
, deleteTempFiles = require(__dirname+'/../../file/deletetempfiles.js') |
|
|
|
, dynamicResponse = require(__dirname+'/../../misc/dynamic.js') |
|
|
|
, dynamicResponse = require(__dirname+'/../../misc/dynamic.js') |
|
|
|
, production = process.env.NODE_ENV === 'production'; |
|
|
|
, production = process.env.NODE_ENV === 'production' |
|
|
|
|
|
|
|
, Permissions = require(__dirname+'/../../permission/permissions.js'); |
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
module.exports = { |
|
|
|
|
|
|
|
|
|
|
@ -13,6 +14,12 @@ module.exports = { |
|
|
|
|
|
|
|
|
|
|
|
const { secureCookies, blockBypass } = config.get; |
|
|
|
const { secureCookies, blockBypass } = config.get; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//bypass captcha permission
|
|
|
|
|
|
|
|
if (res.locals.permissions && |
|
|
|
|
|
|
|
res.locals.permissions.get(Permissions.BYPASS_CAPTCHA)) { |
|
|
|
|
|
|
|
res.locals.solvedCaptcha = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//check if blockbypass exists and right length
|
|
|
|
//check if blockbypass exists and right length
|
|
|
|
const bypassId = req.signedCookies.bypassid; |
|
|
|
const bypassId = req.signedCookies.bypassid; |
|
|
|
if (!res.locals.solvedCaptcha && (!bypassId || bypassId.length !== 24)) { |
|
|
|
if (!res.locals.solvedCaptcha && (!bypassId || bypassId.length !== 24)) { |
|
|
|