From 4419632f83da051c48f98d74760d24658d065942 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 3 Sep 2019 17:56:27 -0400 Subject: [PATCH] Fix false login state on failed login Previously, a failed login would change the site-wide navigation so that it looked like the user was logged in, even though they weren't. This fixes that. --- account.go | 8 ++++---- pages/login.tmpl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/account.go b/account.go index 357bae5..a3eb39d 100644 --- a/account.go +++ b/account.go @@ -309,10 +309,10 @@ func viewLogin(app *App, w http.ResponseWriter, r *http.Request) error { p := &struct { page.StaticPage - To string - Message template.HTML - Flashes []template.HTML - Username string + To string + Message template.HTML + Flashes []template.HTML + LoginUsername string }{ pageForReq(app, r), r.FormValue("to"), diff --git a/pages/login.tmpl b/pages/login.tmpl index 9b58523..1c8e862 100644 --- a/pages/login.tmpl +++ b/pages/login.tmpl @@ -12,8 +12,8 @@ {{end}}
-
-
+
+
{{if .To}}{{end}}