all repos — flounder @ 2cd8c34043237f685ad7da91b589043b1bbe4269

A small site builder for the Gemini protocol

Allow email to login as well
alex wennerberg alex@alexwennerberg.com
Thu, 29 Oct 2020 18:29:36 -0700
commit

2cd8c34043237f685ad7da91b589043b1bbe4269

parent

84556585e5f0af77f4a3c966fd9bb5bbd86937d3

2 files changed, 2 insertions(+), 2 deletions(-)

jump to
M http.gohttp.go

@@ -230,7 +230,7 @@ } else if r.Method == "POST" {

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
M templates/login.htmltemplates/login.html

@@ -2,7 +2,7 @@ {{template "header" .}}

<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>