From d1a63fc7ac58a1db00d8ca4f43aadba02eb9b084 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Sep 2018 14:08:14 +0200 Subject: Fix videos list user NSFW policy --- server/helpers/express-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index 9cf8fbeac..8a9cee8c5 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts @@ -6,6 +6,7 @@ import { User } from '../../shared/models/users' import { deleteFileAsync, generateRandomString } from './utils' import { extname } from 'path' import { isArray } from './custom-validators/misc' +import { UserModel } from '../models/account/user' function buildNSFWFilter (res: express.Response, paramNSFW?: string) { if (paramNSFW === 'true') return true @@ -13,7 +14,7 @@ function buildNSFWFilter (res: express.Response, paramNSFW?: string) { if (paramNSFW === 'both') return undefined if (res.locals.oauth) { - const user: User = res.locals.oauth.token.User + const user: UserModel = res.locals.oauth.token.User // User does not want NSFW videos if (user.nsfwPolicy === 'do_not_list') return false -- cgit v1.2.3