flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 0e234b1c3807aaf2a03d3e1755b90a6fc1e5e7d3
parent b5f05ac3343ad0fa47239c73004abf55f00d363d
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Wed, 10 Feb 2021 20:04:18 -0800

Update status codes on bad login/registration

Diffstat:
Mhttp.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/http.go b/http.go @@ -372,6 +372,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { Error string Config Config }{"Username or email '" + name + "' does not exist", c} + w.WriteHeader(401) t.ExecuteTemplate(w, "login.html", data) return } else { @@ -384,6 +385,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { Error string Config Config }{"Your account is not active yet. Pending admin approval", c} + w.WriteHeader(401) t.ExecuteTemplate(w, "login.html", data) return } @@ -399,6 +401,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { Error string Config Config }{"Invalid login or password", c} + w.WriteHeader(401) err := t.ExecuteTemplate(w, "login.html", data) if err != nil { serverError(w, err) @@ -470,6 +473,7 @@ func registerHandler(w http.ResponseWriter, r *http.Request) { Config Config Errors []string }{c, errors} + w.WriteHeader(400) t.ExecuteTemplate(w, "register.html", data) } else { data := struct {