diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-04 11:19:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-04 11:19:19 +0200 |
commit | eb87f9a4a90ffbac43075567eb0ea90e7379c4b2 (patch) | |
tree | ad4a00e316440839c4df52544ad4e964ed0be2d5 /server/helpers/express-utils.ts | |
parent | b0c36821d1dcf362f14c99ca3741e7d03aea0a04 (diff) | |
download | PeerTube-eb87f9a4a90ffbac43075567eb0ea90e7379c4b2.tar.gz PeerTube-eb87f9a4a90ffbac43075567eb0ea90e7379c4b2.tar.zst PeerTube-eb87f9a4a90ffbac43075567eb0ea90e7379c4b2.zip |
Fix nsfw filter
Diffstat (limited to 'server/helpers/express-utils.ts')
-rw-r--r-- | server/helpers/express-utils.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index b715fb7d0..9cf8fbeac 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts | |||
@@ -14,8 +14,12 @@ function buildNSFWFilter (res: express.Response, paramNSFW?: string) { | |||
14 | 14 | ||
15 | if (res.locals.oauth) { | 15 | if (res.locals.oauth) { |
16 | const user: User = res.locals.oauth.token.User | 16 | const user: User = res.locals.oauth.token.User |
17 | |||
17 | // User does not want NSFW videos | 18 | // User does not want NSFW videos |
18 | if (user && user.nsfwPolicy === 'do_not_list') return false | 19 | if (user.nsfwPolicy === 'do_not_list') return false |
20 | |||
21 | // Both | ||
22 | return undefined | ||
19 | } | 23 | } |
20 | 24 | ||
21 | if (CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list') return false | 25 | if (CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list') return false |