From 3cabaf92f82b34ea2fba90d312a4ddbfdf7df488 Mon Sep 17 00:00:00 2001 From: Jeder Date: Fri, 25 Aug 2023 12:09:41 +0200 Subject: [PATCH] Disable full-text search for visitors --- locales/en-US.yml | 2 ++ .../src/server/api/endpoints/notes/search.ts | 2 +- packages/client/src/pages/search.vue | 20 ++++++++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 746f78170..0245d1709 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1133,6 +1133,8 @@ removeRecipient: "Remove recipient" removeMember: "Remove member" verifiedLink: "Verified link" openInMainColumn: "Open in main column" +searchNotLoggedIn_1: "You have to be authenticated in order to use full text search." +searchNotLoggedIn_2: "However, you can search using hashtags, and search users." _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index b4d83aa0b..a4a904dd2 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -15,7 +15,7 @@ import { sqlLikeEscape } from "@/misc/sql-like-escape.js"; export const meta = { tags: ["notes"], - requireCredential: false, + requireCredential: true, requireCredentialPrivateMode: true, res: { diff --git a/packages/client/src/pages/search.vue b/packages/client/src/pages/search.vue index fdab6636e..8fd7d3b4d 100644 --- a/packages/client/src/pages/search.vue +++ b/packages/client/src/pages/search.vue @@ -25,7 +25,24 @@ @slide-change="onSlideChange" > - + +