all repos — flounder @ e9b49da1c1c88b9ff1c0749c4b6d2a91c43607fb

A small site builder for the Gemini protocol

Force lowercase email and username
alex wennerberg alex@alexwennerberg.com
Thu, 14 Jan 2021 16:41:47 -0800
commit

e9b49da1c1c88b9ff1c0749c4b6d2a91c43607fb

parent

9685675ad5c4d7616c40228a69fe4538b001a3c3

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M http.gohttp.go

@@ -370,7 +370,7 @@ panic(err)

} } else if r.Method == "POST" { r.ParseForm() - name := r.Form.Get("username") + name := strings.ToLower(r.Form.Get("username")) password := r.Form.Get("password") row := DB.QueryRow("SELECT username, password_hash, active, admin FROM user where username = $1 OR email = $1", name) var db_password []byte

@@ -451,7 +451,7 @@ panic(err)

} } else if r.Method == "POST" { r.ParseForm() - email := r.Form.Get("email") + email := strings.ToLower(r.Form.Get("email")) password := r.Form.Get("password") errors := []string{} if r.Form.Get("password") != r.Form.Get("password2") {

@@ -779,7 +779,7 @@ serveMux.HandleFunc(hostname+"/check-domain", checkDomainHandler)

// admin commands serveMux.HandleFunc(hostname+"/admin/user/", adminUserHandler) - // TODO authentication + serveMux.HandleFunc(hostname+"/webdav/", webdavHandler) wrapped := handlers.CustomLoggingHandler(log.Writer(), handlers.RecoveryHandler()(serveMux), logFormatter)