mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-25 16:49:26 +01:00
add support for setting preferences for privacy domains via URL
This commit is contained in:
parent
a72e6e65af
commit
417cfba394
18
routes.js
18
routes.js
@ -64,6 +64,24 @@ module.exports = (app, redis, fetch, RedditAPI) => {
|
||||
res.cookie('show_upvoted_percentage', showUpvotedPercentage, { maxAge: 31536000, httpOnly: true })
|
||||
}
|
||||
|
||||
let domainTwitter = req.query.domain_twitter
|
||||
if(domainTwitter) {
|
||||
req.cookies.domain_twitter = domainTwitter
|
||||
res.cookie('domain_twitter', domainTwitter, { maxAge: 31536000, httpOnly: true })
|
||||
}
|
||||
|
||||
let domainYoutube = req.query.domain_youtube
|
||||
if(domainYoutube) {
|
||||
req.cookies.domain_youtube = domainYoutube
|
||||
res.cookie('domain_youtube', domainYoutube, { maxAge: 31536000, httpOnly: true })
|
||||
}
|
||||
|
||||
let domainInstagram = req.query.domain_instagram
|
||||
if(domainInstagram) {
|
||||
req.cookies.domain_instagram = domainInstagram
|
||||
res.cookie('domain_instagram', domainInstagram, { maxAge: 31536000, httpOnly: true })
|
||||
}
|
||||
|
||||
if(!config.rate_limiting) {
|
||||
return next()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user