Upgraded dependencies, bumped to Node 24.
This commit is contained in:
@@ -4,26 +4,26 @@ export default function consentHandler(req, res, next) {
|
||||
if (Object.hasOwn(req.query, 'lgbt')) {
|
||||
const lgbtFilters = Array.from(new Set([...(req.tagFilter || []).filter((tag) => !['gay', 'bisexual', 'transsexual'].includes(tag)), 'extreme-insertion']));
|
||||
|
||||
req.tagFilter = lgbtFilters; // eslint-disable-line no-param-reassign
|
||||
req.tagFilter = lgbtFilters;
|
||||
res.cookie('tags', JSON.stringify(lgbtFilters));
|
||||
}
|
||||
|
||||
if (Object.hasOwn(req.query, 'straight')) {
|
||||
const straightFilters = Array.from(new Set([...(req.tagFilter || []), 'gay', 'bisexual', 'transsexual', 'extreme-insertion']));
|
||||
|
||||
req.tagFilter = straightFilters; // eslint-disable-line no-param-reassign
|
||||
req.tagFilter = straightFilters;
|
||||
res.cookie('tags', JSON.stringify(straightFilters));
|
||||
}
|
||||
|
||||
if (Object.hasOwn(req.query, 'consent')) {
|
||||
req.session.hasConsent = true; // eslint-disable-line no-param-reassign
|
||||
req.session.hasConsent = true;
|
||||
res.redirect(redirect || req.path);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!req.path.includes('/consent') && !req.session?.hasConsent) {
|
||||
res.redirect(`/consent?redirect=${req.originalUrl === '/' ? '' : encodeURIComponent(req.originalUrl) }`);
|
||||
res.redirect(`/consent?redirect=${req.originalUrl === '/' ? '' : encodeURIComponent(req.originalUrl)}`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user