From dae86118ed5d4026d04acb9d0e36829b9ad8eb4e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Mar 2019 10:35:15 +0100 Subject: Cleanup express locals typings --- server/helpers/express-utils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/helpers') diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index 9a72ee96d..fef2da313 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts @@ -5,7 +5,6 @@ import { logger } from './logger' 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 +12,7 @@ function buildNSFWFilter (res?: express.Response, paramNSFW?: string) { if (paramNSFW === 'both') return undefined if (res && res.locals.oauth) { - const user: UserModel = res.locals.oauth.token.User + const user = res.locals.oauth.token.User // User does not want NSFW videos if (user.nsfwPolicy === 'do_not_list') return false @@ -100,7 +99,7 @@ function createReqFiles ( } function isUserAbleToSearchRemoteURI (res: express.Response) { - const user: UserModel = res.locals.oauth ? res.locals.oauth.token.User : undefined + const user = res.locals.oauth ? res.locals.oauth.token.User : undefined return CONFIG.SEARCH.REMOTE_URI.ANONYMOUS === true || (CONFIG.SEARCH.REMOTE_URI.USERS === true && user !== undefined) -- cgit v1.2.3