flounder

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

commit 2cd8c34043237f685ad7da91b589043b1bbe4269
parent 84556585e5f0af77f4a3c966fd9bb5bbd86937d3
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Thu, 29 Oct 2020 18:29:36 -0700

Allow email to login as well

Diffstat:
Mhttp.go | 2+-
Mtemplates/login.html | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/http.go b/http.go @@ -230,7 +230,7 @@ func loginHandler(w http.ResponseWriter, r *http.Request) { r.ParseForm() name := r.Form.Get("username") password := r.Form.Get("password") - row := DB.QueryRow("SELECT password_hash, active, admin FROM user where username = $1", name) + row := DB.QueryRow("SELECT password_hash, active, admin FROM user where username = $1 OR email = $1", name) var db_password []byte var active bool var isAdmin bool diff --git a/templates/login.html b/templates/login.html @@ -2,7 +2,7 @@ <h1>Login</h1> <form action="/login" method="post"> <p> - <label for="username">Username</label> + <label for="username">Username or Email</label> <input id="username" name="username" size="32" type="text" value="" /> </p> <p>