From 151ec71163aec86b3f7d24c12cb2f150a9aa6c7f Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 2 Mar 2020 16:32:04 -0600 Subject: [PATCH] Land on login form for private instances --- app.go | 4 ++++ templates/base.tmpl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index dd05c95..048c8d0 100644 --- a/app.go +++ b/app.go @@ -221,6 +221,10 @@ func handleViewHome(app *App, w http.ResponseWriter, r *http.Request) error { return handleViewPad(app, w, r) } + if app.cfg.App.Private { + return viewLogin(app, w, r) + } + if land := app.cfg.App.LandingPath(); land != "/" { return impart.HTTPError{http.StatusFound, land} } diff --git a/templates/base.tmpl b/templates/base.tmpl index 3826917..ef44121 100644 --- a/templates/base.tmpl +++ b/templates/base.tmpl @@ -48,7 +48,7 @@ {{ end }} {{if and (and .LocalTimeline .CanViewReader) (not .Chorus)}}Reader{{end}} {{if and (and (and .Chorus .OpenRegistration) (not .Username)) (or (not .Private) (ne .Landing ""))}}Sign up{{end}} - {{if not .Username}}Log in{{else if .SimpleNav}}Log out{{end}} + {{if and (not .Username) (not .Private)}}Log in{{else if .SimpleNav}}Log out{{end}} {{ end }} {{if .Chorus}}{{if .Username}}