Show private and unlisted posts in indices when logged in (#26)

This commit is contained in:
Jan-Lukas Else 2022-07-31 19:20:46 +02:00
parent 548ba794aa
commit b72089bc4a
1 changed files with 3 additions and 0 deletions

View File

@ -283,6 +283,9 @@ func (a *goBlog) serveIndex(w http.ResponseWriter, r *http.Request) {
} }
if len(statusse) == 0 { if len(statusse) == 0 {
statusse = []postStatus{statusPublished} statusse = []postStatus{statusPublished}
if a.isLoggedIn(r) {
statusse = append(statusse, statusPrivate, statusUnlisted)
}
} }
p := paginator.New(&postPaginationAdapter{config: &postsRequestConfig{ p := paginator.New(&postPaginationAdapter{config: &postsRequestConfig{
blog: blog, blog: blog,