diff options
-rw-r--r-- | server/controllers/api/search.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts index e35a7346e..a0da5e30c 100644 --- a/server/controllers/api/search.ts +++ b/server/controllers/api/search.ts | |||
@@ -173,7 +173,11 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons | |||
173 | 173 | ||
174 | // Use the default instance NSFW policy if not specified | 174 | // Use the default instance NSFW policy if not specified |
175 | if (!body.nsfw) { | 175 | if (!body.nsfw) { |
176 | body.nsfw = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list' | 176 | const nsfwPolicy = res.locals.oauth |
177 | ? res.locals.oauth.token.User.nsfwPolicy | ||
178 | : CONFIG.INSTANCE.DEFAULT_NSFW_POLICY | ||
179 | |||
180 | body.nsfw = nsfwPolicy === 'do_not_list' | ||
177 | ? 'false' | 181 | ? 'false' |
178 | : 'both' | 182 | : 'both' |
179 | } | 183 | } |