Skip to content

Commit e44bd79

Browse files
committed
fix(publish): hide protected pages from ref and user listings
1 parent 0a077d1 commit e44bd79

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

deps/publish/src/logseq/publish/meta_store.cljs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,12 @@
318318
"pages.short_id, "
319319
"MAX(page_refs.updated_at) AS updated_at "
320320
"FROM page_refs "
321-
"LEFT JOIN pages "
321+
"INNER JOIN pages "
322322
"ON pages.graph_uuid = page_refs.graph_uuid "
323323
"AND pages.page_uuid = page_refs.source_page_uuid "
324-
"WHERE (lower(page_refs.target_page_title) = lower(?)) "
325-
"OR (page_refs.target_page_name = lower(?)) "
324+
"WHERE ((lower(page_refs.target_page_title) = lower(?)) "
325+
"OR (page_refs.target_page_name = lower(?))) "
326+
"AND pages.password_hash IS NULL "
326327
"GROUP BY page_refs.graph_uuid, page_refs.source_page_uuid, page_refs.source_page_title, pages.short_id "
327328
"ORDER BY updated_at DESC;")
328329
ref-name
@@ -347,7 +348,10 @@
347348
rows (publish-common/get-sql-rows
348349
(publish-common/sql-exec sql
349350
(str "SELECT page_uuid, page_title, short_id, graph_uuid, updated_at, owner_username "
350-
"FROM pages WHERE owner_username = ? ORDER BY updated_at DESC;")
351+
"FROM pages "
352+
"WHERE owner_username = ? "
353+
"AND password_hash IS NULL "
354+
"ORDER BY updated_at DESC;")
351355
username))]
352356
(publish-common/json-response {:user {:username username}
353357
:pages (map (fn [row]

0 commit comments

Comments
 (0)